/*
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>.
 */
package com.l2emu;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.StringTokenizer;
import java.util.logging.Logger;

import javolution.util.FastList;
import javolution.util.FastMap;

import com.l2emu.gameserver.util.FloodProtectorConfig;
import com.l2emu.gameserver.util.StringUtil;
import com.l2emu.gameserver.util.Util;

/** 
 * @author lord_rex
 * @version 1.0.3
 * Configurations for L2EmuProject!
 */
public final class Config
{
	protected static final Logger _log = Logger.getLogger(Config.class.getName());

	//--------------------------------------------------
	// L2J Property File Definitions
	//--------------------------------------------------
	public static final String FORTSIEGE_CONFIGURATION_FILE = "./config/main/fortsiege.properties";	
	public static final String SIEGE_CONFIGURATION_FILE = "./config/main/siege.properties";
	public static final String SEVEN_SIGNS_DATA_FILE = "./config/main/seven_signs.properties";
	public static final String OLYMPIAD_SAVE_FILE = "./config/main/olympiad_save.properties"; 
	public static final String EXTENSIONS_CONFIG_FILE = "./config/main/extensions.properties";

	
	//=======================================================================================================
	public static final String	DATAPACK_VERSION_FILE	= "./config/versionning/datapack-version.properties";
	//=======================================================================================================
	public static String		DATAPACK_REVISION;
	public static String		DATAPACK_BUILD_DATE;

	// ************************************************************************
	public static void loadDatapackBuildConfig()
	{
		_log.info("Loading: " + DATAPACK_VERSION_FILE);
		InputStream is = null;
		try
		{
			File file = new File(DATAPACK_VERSION_FILE);

			if (!file.exists())
			{
				DATAPACK_REVISION = "unknown";
				DATAPACK_BUILD_DATE = "unknown";
				_log.warning("Unable to Find File: " + DATAPACK_VERSION_FILE + " please update your datapack!");
				return;
			}
		
			Properties datapackVersionSettings = new Properties();
			is = new FileInputStream(new File(DATAPACK_VERSION_FILE));
			datapackVersionSettings.load(is);

			DATAPACK_REVISION = datapackVersionSettings.getProperty("version", "unknown");
			DATAPACK_BUILD_DATE = datapackVersionSettings.getProperty("builddate", "unknown");
		}
		catch (Exception e)
		{
			e.printStackTrace();
			throw new Error("Failed to Load " + DATAPACK_VERSION_FILE + " File.");
		}
	}
	
	//=========================================================================================
	public static final String	BUILD_DATE_FILE	= "./config/versionning/build-time.properties";
	//=========================================================================================
	public static String		BUILD_DATE;

	//*******************************************************************
	public static void loadBuildDateConfig()
	{
		_log.info("Loading: " + BUILD_DATE_FILE + ".");
		InputStream is = null;
		try
		{
			File file = new File(BUILD_DATE_FILE);

			if (!file.exists())
			{
				BUILD_DATE = "unknown";
				_log.warning("Unable to Find File: " + BUILD_DATE_FILE + " please update your Gameserver!");
				return;
			}

			Properties buildDateSettings = new Properties();
			is = new FileInputStream(new File(BUILD_DATE_FILE));
			buildDateSettings.load(is);

			BUILD_DATE = buildDateSettings.getProperty("build.time", "unknown");
		}
		catch (Exception e)
		{
			e.printStackTrace();
			throw new Error("Failed to Load " + BUILD_DATE_FILE + " File.");
		}
	}

	//============================================================================================
	public static final String	BUILD_INFO_FILE	= "./config/versionning/build-version.properties";
	//============================================================================================
	public static String		MANIFEST_VERSION;
	public static String		IMPLEMENTATION_VERSION;
	public static String		BUILD_JDK;
	public static String		BUILT_BY;
	public static String		CREATED_BY;
	public static String		IMPLEMENTATION_BUILD;
	public static String		ARCHIVER_VERSION;

	//*******************************************************************
	public static void loadBuildInfoConfig()
	{
		_log.info("Loading: " + BUILD_INFO_FILE + ".");
		InputStream is = null;
		try
		{
			File file = new File(BUILD_INFO_FILE);

			if (!file.exists())
			{
				BUILD_DATE = "unknown";
				_log.warning("Unable to Find File: " + BUILD_INFO_FILE + " please update your Gameserver!");
				return;
			}

			Properties buildInfoSettings = new Properties();
			is = new FileInputStream(new File(BUILD_INFO_FILE));
			buildInfoSettings.load(is);

			MANIFEST_VERSION = buildInfoSettings.getProperty("Manifest-Version", "unknown");
			IMPLEMENTATION_VERSION = buildInfoSettings.getProperty("Implementation-Version", "unknown");
			BUILD_JDK = buildInfoSettings.getProperty("Build-Jdk", "unknown");
			BUILT_BY = buildInfoSettings.getProperty("Built-By", "unknown");
			CREATED_BY = buildInfoSettings.getProperty("Created-By", "unknown");
			IMPLEMENTATION_BUILD = buildInfoSettings.getProperty("Implementation-Build", "unknown");
			ARCHIVER_VERSION = buildInfoSettings.getProperty("Archiver-Version", "unknown");
		}
		catch (Exception e)
		{
			e.printStackTrace();
			throw new Error("Failed to Load " + BUILD_DATE_FILE + " File.");
		}
	}
	
	//--------------------------------------------------
	// No classification assigned to the following yet
	//--------------------------------------------------
	public static int MAX_ITEM_IN_PACKET;
	public static boolean CHECK_KNOWN;
	public static int GAME_SERVER_LOGIN_PORT;
	public static String GAME_SERVER_LOGIN_HOST;
	public static String INTERNAL_HOSTNAME;
	public static String EXTERNAL_HOSTNAME;
	public static int PATH_NODE_RADIUS;
	public static int NEW_NODE_ID;
	public static int SELECTED_NODE_ID;
	public static int LINKED_NODE_ID;
	public static String NEW_NODE_TYPE;
	public static int IP_UPDATE_TIME;
	public static String SERVER_VERSION;
	public static String SERVER_BUILD_DATE;
	public static String DATAPACK_VERSION;
	public static String NONDROPPABLE_ITEMS;
	public static List<Integer> LIST_NONDROPPABLE_ITEMS = new FastList<Integer>();
	public static boolean COUNT_PACKETS = false;
	public static boolean DUMP_PACKET_COUNTS = false;
	public static int DUMP_INTERVAL_SECONDS = 60;
	public static boolean SHOW_LICENCE;
	public static boolean FORCE_GGAUTH;
	public static boolean ACCEPT_NEW_GAMESERVER;
	public static int MINIMUM_UPDATE_DISTANCE;
	public static int KNOWNLIST_FORGET_DELAY;
	public static int MINIMUN_UPDATE_TIME;
	public static boolean AUTO_CREATE_ACCOUNTS;
	public static boolean FLOOD_PROTECTION;
	public static int FAST_CONNECTION_LIMIT;
	public static int NORMAL_CONNECTION_TIME;
	public static int FAST_CONNECTION_TIME;
	public static int MAX_CONNECTION_PER_IP;
	
	/** ------------------------------------ Network Section - Start ------------------------------------ **/
	
	//-------------------------------------------------------------------------------------------------------
	// Network Settings
	//-------------------------------------------------------------------------------------------------------

	public static int PORT_GAME;
	public static int PORT_LOGIN;
	public static String LOGIN_BIND_ADDRESS;
	public static int LOGIN_TRY_BEFORE_BAN;
	public static int LOGIN_BLOCK_AFTER_BAN;
	public static String GAMESERVER_HOSTNAME;
	public static String DATABASE_DRIVER;
	public static String DATABASE_URL;
	public static String DATABASE_LOGIN;
	public static String DATABASE_PASSWORD;
	public static int DATABASE_MAX_CONNECTIONS;
	public static int DATABASE_MAX_IDLE_TIME;
	public static boolean RESERVE_HOST_ON_LOGIN = false;
	public static boolean LOG_LOGIN_CONTROLLER;
	
	//=======================================================================================================
	public static final String NETWORK_FILE = "./config/network/network.properties";
	//=======================================================================================================
	
	public static void loadNetworkConfig()
	{
		_log.info("Loading: " + NETWORK_FILE);
		InputStream is = null;
				try
				{
					Properties serverSettings = new Properties();
					is = new FileInputStream(new File(NETWORK_FILE));
					serverSettings.load(is);

					GAMESERVER_HOSTNAME = serverSettings.getProperty("GameserverHostname");
					PORT_GAME = Integer.parseInt(serverSettings.getProperty("GameserverPort", "7777"));

					EXTERNAL_HOSTNAME = serverSettings.getProperty("ExternalHostname", "*");
					INTERNAL_HOSTNAME = serverSettings.getProperty("InternalHostname", "*");

					GAME_SERVER_LOGIN_PORT = Integer.parseInt(serverSettings.getProperty("LoginPort","9014"));
					GAME_SERVER_LOGIN_HOST = serverSettings.getProperty("LoginHost","127.0.0.1");

					DATABASE_DRIVER = serverSettings.getProperty("Driver", "com.mysql.jdbc.Driver");
					DATABASE_URL = serverSettings.getProperty("URL", "jdbc:mysql://localhost/L2Emu_DB");
					DATABASE_LOGIN = serverSettings.getProperty("Login", "root");
					DATABASE_PASSWORD = serverSettings.getProperty("Password", "");
					DATABASE_MAX_CONNECTIONS = Integer.parseInt(serverSettings.getProperty("MaximumDbConnections", "10"));
					DATABASE_MAX_IDLE_TIME = Integer.parseInt(serverSettings.getProperty("MaximumDbIdleTime", "0"));
				}
			catch (Exception e)
			{
				e.printStackTrace();
				throw new Error("Failed to Load " + NETWORK_FILE + " File.");
			}
	}
	
	//-------------------------------------------------------------------------------------------------------
	// Telnet Settings
	//-------------------------------------------------------------------------------------------------------

	public static boolean IS_TELNET_ENABLED;
	
	//=======================================================================================================
	public static final String TELNET_FILE = "./config/network/telnet.properties";
	//=======================================================================================================

	
	public static void loadTelnetConfig()
	{
		_log.info("Loading: " + TELNET_FILE);
		InputStream is = null;

				// Load Telnet Properties file (if exists)
				try
				{
					Properties telnetSettings = new Properties();
					is = new FileInputStream(new File(TELNET_FILE));
					telnetSettings.load(is);

					IS_TELNET_ENABLED = Boolean.parseBoolean(telnetSettings.getProperty("EnableTelnet", "false"));
				}
			catch (Exception e)
			{
				e.printStackTrace();
				throw new Error("Failed to Load " + TELNET_FILE + " File.");
			}
	}
	
	//-------------------------------------------------------------------------------------------------------
	// HexID Settings
	//-------------------------------------------------------------------------------------------------------
	public static int SERVER_ID;
	public static byte[] HEX_ID;
	
	//=======================================================================================================
	public static final String HEXID_FILE = "./config/network/hexid.txt"; 
	//=======================================================================================================
	
	public static void loadHexID()
	{
		_log.info("Loading: " + HEXID_FILE);
		InputStream is = null;

				try
				{
					Properties Settings = new Properties();
					is = new FileInputStream(HEXID_FILE);
					Settings.load(is);
					SERVER_ID = Integer.parseInt(Settings.getProperty("ServerID"));
					HEX_ID = new BigInteger(Settings.getProperty("HexID"), 16).toByteArray();
				}
				catch (Exception e)
				{
					_log.warning("Could not load HexID file (" + HEXID_FILE + "). Hopefully login will give us one.");
				}
			finally
			{
				try
				{
					is.close();
				}
				catch (Exception e) { }
			}
	}
	
	/** -------------------------------------- Network Section - End ------------------------------------ **/
	
	/** -------------------------------------- Main Section - Start ------------------------------------- **/
	
	//-------------------------------------------------------------------------------------------------------
	// Game Server Settings
	//-------------------------------------------------------------------------------------------------------
	public static int MAXIMUM_ONLINE_USERS;
	public static String CNAME_TEMPLATE;
	public static String PET_NAME_TEMPLATE;
	public static int MAX_CHARACTERS_NUMBER_PER_ACCOUNT;
	public static File DATAPACK_ROOT;
	public static boolean ACCEPT_ALTERNATE_ID;
	public static int REQUEST_ID;
	public static int MIN_PROTOCOL_REVISION;
	public static int MAX_PROTOCOL_REVISION;
	
	//=======================================================================================================
	public static final String GAMESERVER_FILE = "./config/main/gameserver.properties"; 
	//=======================================================================================================
	
	public static void loadGSConfig()
	{
		_log.info("Loading: " + GAMESERVER_FILE);
		InputStream is = null;
			
			// Load Game Server Properties file (if exists)
			try
			{
				Properties gsSettings = new Properties();
				is = new FileInputStream(new File(GAMESERVER_FILE));
				gsSettings.load(is);
				
				REQUEST_ID = Integer.parseInt(gsSettings.getProperty("RequestServerID","0"));
				ACCEPT_ALTERNATE_ID = Boolean.parseBoolean(gsSettings.getProperty("AcceptAlternateID","True"));
				
				DATAPACK_ROOT = new File(gsSettings.getProperty("DatapackRoot", ".")).getCanonicalFile();

				CNAME_TEMPLATE = gsSettings.getProperty("CnameTemplate", ".*");
				PET_NAME_TEMPLATE = gsSettings.getProperty("PetNameTemplate", ".*");

				MAX_CHARACTERS_NUMBER_PER_ACCOUNT = Integer.parseInt(gsSettings.getProperty("CharMaxNumber", "0"));
				MAXIMUM_ONLINE_USERS = Integer.parseInt(gsSettings.getProperty("MaximumOnlineUsers", "100"));

				MIN_PROTOCOL_REVISION = Integer.parseInt(gsSettings.getProperty("MinProtocolRevision", "660"));
				MAX_PROTOCOL_REVISION = Integer.parseInt(gsSettings.getProperty("MaxProtocolRevision", "665"));

				if (MIN_PROTOCOL_REVISION > MAX_PROTOCOL_REVISION)
				{
					throw new Error("MinProtocolRevision is bigger than MaxProtocolRevision in server configuration file.");
				}
			}
		catch (Exception e)
		{
			e.printStackTrace();
			throw new Error("Failed to Load " + GAMESERVER_FILE + " File.");
		}
	}
	
	//-------------------------------------------------------------------------------------------------------
	// ID Factory Settings
	//-------------------------------------------------------------------------------------------------------
	public static enum IdFactoryType
	{
		Compaction,
		BitSet,
		Stack
	}
	public static IdFactoryType IDFACTORY_TYPE;
	public static boolean BAD_ID_CHECKING;
	public static enum ObjectMapType
	{
		L2ObjectHashMap,
		WorldObjectMap
	}
	public static enum ObjectSetType
	{
		L2ObjectHashSet,
		WorldObjectSet
	}
	public static ObjectMapType MAP_TYPE;
	public static ObjectSetType SET_TYPE;
	
	//=======================================================================================================
	public static final String ID_CONFIG_FILE = "./config/main/id_factory.properties"; 
	//=======================================================================================================
	
	public static void loadIDFactoryConfig()
	{
		_log.info("Loading: " + ID_CONFIG_FILE);
		InputStream is = null;

				// Load IdFactory Properties file (if exists)
				try
				{
					Properties idSettings = new Properties();
					is = new FileInputStream(new File(ID_CONFIG_FILE));
					idSettings.load(is);

					MAP_TYPE = ObjectMapType.valueOf(idSettings.getProperty("L2Map", "WorldObjectMap"));
					SET_TYPE = ObjectSetType.valueOf(idSettings.getProperty("L2Set", "WorldObjectSet"));
					IDFACTORY_TYPE = IdFactoryType.valueOf(idSettings.getProperty("IDFactory", "Compaction"));
					BAD_ID_CHECKING = Boolean.parseBoolean(idSettings.getProperty("BadIdChecking", "True"));
				}
			catch (Exception e)
			{
				e.printStackTrace();
				throw new Error("Failed to Load " + ID_CONFIG_FILE + " file.");
			}
	}
	
	//-------------------------------------------------------------------------------------------------------
	// GeoData Settings
	//-------------------------------------------------------------------------------------------------------
	public static int GEODATA;
	public static boolean GEODATA_CELLFINDING;
	public static boolean FORCE_GEODATA;
	public static File GEODATA_ROOT;
	
	//=======================================================================================================
	public static final String GEODATA_FILE = "./config/main/geodata.properties"; 
	//=======================================================================================================
	
	public static void loadGeoDataConfig()
	{
		_log.info("Loading: " + GEODATA_FILE);
		InputStream is = null;
			
			// Load GeoData Properties file (if exists)
			try
			{
				Properties geodataSettings = new Properties();
				is = new FileInputStream(new File(GEODATA_FILE));
				geodataSettings.load(is);
				
				GEODATA = Integer.parseInt(geodataSettings.getProperty("GeoData", "0"));
				GEODATA_CELLFINDING = Boolean.parseBoolean(geodataSettings.getProperty("CellPathFinding", "False"));
				FORCE_GEODATA = Boolean.parseBoolean(geodataSettings.getProperty("ForceGeodata", "True"));
				GEODATA_ROOT = new File(geodataSettings.getProperty("GeoDataRoot", ".")).getCanonicalFile();
			}
		catch (Exception e)
		{
			e.printStackTrace();
			throw new Error("Failed to Load " + GEODATA_FILE + " File.");
		}
	}
	
	//-------------------------------------------------------------------------------------------------------
	// Rate Settings
	//-------------------------------------------------------------------------------------------------------
	public static float RATE_XP;
	public static float RATE_SP;
	public static float RATE_PARTY_XP;
	public static float RATE_PARTY_SP;
	public static float RATE_QUESTS_REWARD;
	public static float RATE_DROP_ADENA;
	public static float RATE_CONSUMABLE_COST;
	public static float	RATE_ITEM_COST;
	public static float RATE_EXTR_FISH;
	public static float RATE_DROP_ITEMS;
	public static float RATE_DROP_ITEMS_BY_RAID;
	public static float RATE_DROP_SPOIL;
	public static int RATE_DROP_MANOR;
	public static float RATE_DROP_QUEST;
	public static float RATE_KARMA_EXP_LOST;
	public static float RATE_SIEGE_GUARDS_PRICE;
	public static float RATE_DROP_COMMON_HERBS;
	public static float RATE_DROP_MP_HP_HERBS;
	public static float RATE_DROP_GREATER_HERBS;
	public static float RATE_DROP_SUPERIOR_HERBS;
	public static float RATE_DROP_SPECIAL_HERBS;
	public static int PLAYER_DROP_LIMIT;
	public static int PLAYER_RATE_DROP;
	public static int PLAYER_RATE_DROP_ITEM;
	public static int PLAYER_RATE_DROP_EQUIP;
	public static int PLAYER_RATE_DROP_EQUIP_WEAPON;
	public static float PET_XP_RATE;
	public static int PET_FOOD_RATE;
	public static float SINEATER_XP_RATE;
	public static int KARMA_DROP_LIMIT;
	public static int KARMA_RATE_DROP;
	public static int KARMA_RATE_DROP_ITEM;
	public static int KARMA_RATE_DROP_EQUIP;
	public static int KARMA_RATE_DROP_EQUIP_WEAPON;
	public static double[] PLAYER_XP_PERCENT_LOST;
	public static float RATE_RUN_SPEED;
	
	//=======================================================================================================
	public static final String RATES_CONFIG_FILE = "./config/main/rates.properties"; 
	//=======================================================================================================
	
	public static void loadRatesConfig()
	{
		_log.info("Loading: " + RATES_CONFIG_FILE);
		InputStream is = null;

				// Load Rates Properties file (if exists)
				try
				{
					Properties ratesSettings = new Properties();
					is = new FileInputStream(new File(RATES_CONFIG_FILE));
					ratesSettings.load(is);

					RATE_XP = Float.parseFloat(ratesSettings.getProperty("RateXp", "1."));
					RATE_SP = Float.parseFloat(ratesSettings.getProperty("RateSp", "1."));
					RATE_PARTY_XP = Float.parseFloat(ratesSettings.getProperty("RatePartyXp", "1."));
					RATE_PARTY_SP = Float.parseFloat(ratesSettings.getProperty("RatePartySp", "1."));
					RATE_QUESTS_REWARD = Float.parseFloat(ratesSettings.getProperty("RateQuestsReward", "1."));
					RATE_DROP_ADENA = Float.parseFloat(ratesSettings.getProperty("RateDropAdena", "1."));
					RATE_CONSUMABLE_COST = Float.parseFloat(ratesSettings.getProperty("RateConsumableCost", "1."));
					RATE_ITEM_COST = Float.parseFloat(ratesSettings.getProperty("RateItemCost", "1."));
					RATE_EXTR_FISH = Float.parseFloat(ratesSettings.getProperty("RateExtractFish", "1."));
					RATE_DROP_ITEMS = Float.parseFloat(ratesSettings.getProperty("RateDropItems", "1."));
					RATE_DROP_ITEMS_BY_RAID = Float.parseFloat(ratesSettings.getProperty("RateRaidDropItems", "1."));
					RATE_DROP_SPOIL = Float.parseFloat(ratesSettings.getProperty("RateDropSpoil", "1."));
					RATE_DROP_MANOR = Integer.parseInt(ratesSettings.getProperty("RateDropManor", "1"));
					RATE_DROP_QUEST = Float.parseFloat(ratesSettings.getProperty("RateDropQuest", "1."));
					RATE_KARMA_EXP_LOST = Float.parseFloat(ratesSettings.getProperty("RateKarmaExpLost", "1."));
					RATE_SIEGE_GUARDS_PRICE = Float.parseFloat(ratesSettings.getProperty("RateSiegeGuardsPrice", "1."));
					RATE_DROP_COMMON_HERBS = Float.parseFloat(ratesSettings.getProperty("RateCommonHerbs", "15."));
					RATE_DROP_MP_HP_HERBS = Float.parseFloat(ratesSettings.getProperty("RateHpMpHerbs", "10."));
					RATE_DROP_GREATER_HERBS = Float.parseFloat(ratesSettings.getProperty("RateGreaterHerbs", "4."));
					RATE_DROP_SUPERIOR_HERBS = Float.parseFloat(ratesSettings.getProperty("RateSuperiorHerbs", "0.8"))*10;
					RATE_DROP_SPECIAL_HERBS = Float.parseFloat(ratesSettings.getProperty("RateSpecialHerbs", "0.2"))*10;
					PLAYER_DROP_LIMIT = Integer.parseInt(ratesSettings.getProperty("PlayerDropLimit", "3"));
					PLAYER_RATE_DROP = Integer.parseInt(ratesSettings.getProperty("PlayerRateDrop", "5"));
					PLAYER_RATE_DROP_ITEM = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropItem", "70"));
					PLAYER_RATE_DROP_EQUIP = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropEquip", "25"));
					PLAYER_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(ratesSettings.getProperty("PlayerRateDropEquipWeapon", "5"));
					PET_XP_RATE = Float.parseFloat(ratesSettings.getProperty("PetXpRate", "1."));
					PET_FOOD_RATE = Integer.parseInt(ratesSettings.getProperty("PetFoodRate", "1"));
					SINEATER_XP_RATE = Float.parseFloat(ratesSettings.getProperty("SinEaterXpRate", "1."));
					KARMA_DROP_LIMIT = Integer.parseInt(ratesSettings.getProperty("KarmaDropLimit", "10"));
					KARMA_RATE_DROP = Integer.parseInt(ratesSettings.getProperty("KarmaRateDrop", "70"));
					KARMA_RATE_DROP_ITEM = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropItem", "50"));
					KARMA_RATE_DROP_EQUIP = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropEquip", "40"));
					KARMA_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(ratesSettings.getProperty("KarmaRateDropEquipWeapon", "10"));
					
					// Initializing table
					PLAYER_XP_PERCENT_LOST = new double[Byte.MAX_VALUE+1];
					
					// Default value
					for (int i = 0; i <= Byte.MAX_VALUE; i++)
						PLAYER_XP_PERCENT_LOST[i] = 1.;
					
					// Now loading into table parsed values
					try
					{
						String[] values = ratesSettings.getProperty("PlayerXPPercentLost", "0,39-7.0;40,75-4.0;76,76-2.5;77,77-2.0;78,78-1.5").split(";");
						
						for (String s : values)
						{
							int min;
							int max;
							double val;
							
							String[] vals = s.split("-");
							String[] mM = vals[0].split(",");
							
							min = Integer.parseInt(mM[0]);
							max = Integer.parseInt(mM[1]);
							val = Double.parseDouble(vals[1]);
							
							for (int i = min; i <= max; i++)
								PLAYER_XP_PERCENT_LOST[i] = val;
						}
					}
					catch (Exception e)
					{
						_log.warning("Error while loading Player XP percent lost");
						e.printStackTrace();
					}
					
					RATE_RUN_SPEED = Float.parseFloat(ratesSettings.getProperty("RateRunSpeed", "1."));

				}
			catch (Exception e)
			{
				e.printStackTrace();
				throw new Error("Failed to Load " + RATES_CONFIG_FILE + " File.");
			}
	}
	
	//-------------------------------------------------------------------------------------------------------
	// PvP Settings
	//-------------------------------------------------------------------------------------------------------
	public static int KARMA_MIN_KARMA;
	public static int KARMA_MAX_KARMA;
	public static int KARMA_XP_DIVIDER;
	public static int KARMA_LOST_BASE;
	public static boolean KARMA_DROP_GM;
	public static boolean KARMA_AWARD_PK_KILL;
	public static int KARMA_PK_LIMIT;
	public static String KARMA_NONDROPPABLE_PET_ITEMS;
	public static String KARMA_NONDROPPABLE_ITEMS;
 	public static int[] KARMA_LIST_NONDROPPABLE_PET_ITEMS; 
 	public static int[] KARMA_LIST_NONDROPPABLE_ITEMS;
	public static int PVP_NORMAL_TIME;
	public static int PVP_PVP_TIME;
	
	//=======================================================================================================
	public static final String PVP_CONFIG_FILE = "./config/main/pvp.properties"; 
	//=======================================================================================================
	
	public static void loadPvpConfig()
	{
		_log.info("Loading: " + PVP_CONFIG_FILE);
		InputStream is = null;

				// Load PvP Properties file (if exists)
				try
				{
					Properties pvpSettings = new Properties();
					is = new FileInputStream(new File(PVP_CONFIG_FILE));
					pvpSettings.load(is);

					KARMA_MIN_KARMA = Integer.parseInt(pvpSettings.getProperty("MinKarma", "240"));
					KARMA_MAX_KARMA = Integer.parseInt(pvpSettings.getProperty("MaxKarma", "10000"));
					KARMA_XP_DIVIDER = Integer.parseInt(pvpSettings.getProperty("XPDivider", "260"));
					KARMA_LOST_BASE = Integer.parseInt(pvpSettings.getProperty("BaseKarmaLost", "0"));
					KARMA_DROP_GM = Boolean.parseBoolean(pvpSettings.getProperty("CanGMDropEquipment", "false"));
					KARMA_AWARD_PK_KILL = Boolean.parseBoolean(pvpSettings.getProperty("AwardPKKillPVPPoint", "true"));
					KARMA_PK_LIMIT = Integer.parseInt(pvpSettings.getProperty("MinimumPKRequiredToDrop", "5"));
					KARMA_NONDROPPABLE_PET_ITEMS = pvpSettings.getProperty("ListOfPetItems", "2375,3500,3501,3502,4422,4423,4424,4425,6648,6649,6650,9882");
					KARMA_NONDROPPABLE_ITEMS = pvpSettings.getProperty("ListOfNonDroppableItems", "57,1147,425,1146,461,10,2368,7,6,2370,2369,6842,6611,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621,7694,8181,5575,7694,9388,9389,9390");
					
					String[] array = KARMA_NONDROPPABLE_PET_ITEMS.split(",");
					KARMA_LIST_NONDROPPABLE_PET_ITEMS = new int[array.length];
					
					for (int i = 0; i < array.length; i++)
						KARMA_LIST_NONDROPPABLE_PET_ITEMS[i] = Integer.parseInt(array[i]);
					
					array = KARMA_NONDROPPABLE_ITEMS.split(",");
					KARMA_LIST_NONDROPPABLE_ITEMS = new int[array.length];
					
					for (int i = 0; i < array.length; i++)
						KARMA_LIST_NONDROPPABLE_ITEMS[i] = Integer.parseInt(array[i]);
					
					// sorting so binarySearch can be used later
					Arrays.sort(KARMA_LIST_NONDROPPABLE_PET_ITEMS);
					Arrays.sort(KARMA_LIST_NONDROPPABLE_ITEMS);
					
					PVP_NORMAL_TIME = Integer.parseInt(pvpSettings.getProperty("PvPVsNormalTime", "120000"));
					PVP_PVP_TIME = Integer.parseInt(pvpSettings.getProperty("PvPVsPvPTime", "60000"));
				}
			catch (Exception e)
			{
				e.printStackTrace();
				throw new Error("Failed to Load " + PVP_CONFIG_FILE + " File.");
			}
	}
	
	//-------------------------------------------------------------------------------------------------------
	// Enchant Settings
	//-------------------------------------------------------------------------------------------------------
	public static int ENCHANT_CHANCE_WEAPON;
	public static int ENCHANT_CHANCE_ARMOR;
	public static int ENCHANT_CHANCE_JEWELRY;
	public static int BLESSED_ENCHANT_CHANCE_WEAPON;
	public static int BLESSED_ENCHANT_CHANCE_ARMOR;
	public static int BLESSED_ENCHANT_CHANCE_JEWELRY;
	public static int ENCHANT_MAX_WEAPON;
	public static int ENCHANT_MAX_ARMOR;
	public static int ENCHANT_MAX_JEWELRY;
	public static int ENCHANT_SAFE_MAX;
	public static int ENCHANT_SAFE_MAX_FULL;
	public static int AUGMENTATION_NG_SKILL_CHANCE;
	public static int AUGMENTATION_NG_GLOW_CHANCE;
	public static int AUGMENTATION_MID_SKILL_CHANCE;
	public static int AUGMENTATION_MID_GLOW_CHANCE;
	public static int AUGMENTATION_HIGH_SKILL_CHANCE;
	public static int AUGMENTATION_HIGH_GLOW_CHANCE;
	public static int AUGMENTATION_TOP_SKILL_CHANCE;
	public static int AUGMENTATION_TOP_GLOW_CHANCE;
	public static int AUGMENTATION_BASESTAT_CHANCE;
	public static boolean ALLOW_ENCHANT_HERO_WEAPONS;
	
	//=======================================================================================================
	public static final String ENCHANT_FILE = "./config/main/enchant.properties"; 
	//=======================================================================================================
	
	public static void loadEnchantConfig()
	{
		_log.info("Loading: " + ENCHANT_FILE);
		InputStream is = null;

				// Load Enchant Properties file (if exists)
				try
				{
					Properties enchantSettings = new Properties();
					is = new FileInputStream(new File(ENCHANT_FILE));
					enchantSettings.load(is);
					
					ENCHANT_CHANCE_WEAPON = Integer.parseInt(enchantSettings.getProperty("EnchantChanceWeapon", "66"));
					ENCHANT_CHANCE_ARMOR = Integer.parseInt(enchantSettings.getProperty("EnchantChanceArmor", "66"));
					ENCHANT_CHANCE_JEWELRY = Integer.parseInt(enchantSettings.getProperty("EnchantChanceJewelry", "66"));
					BLESSED_ENCHANT_CHANCE_WEAPON = Integer.parseInt(enchantSettings.getProperty("BlessedEnchantChanceWeapon", "66"));
					BLESSED_ENCHANT_CHANCE_ARMOR = Integer.parseInt(enchantSettings.getProperty("BlessedEnchantChanceArmor", "66"));
					BLESSED_ENCHANT_CHANCE_JEWELRY = Integer.parseInt(enchantSettings.getProperty("BlessedEnchantChanceJewelry", "66"));
					ENCHANT_MAX_WEAPON = Integer.parseInt(enchantSettings.getProperty("EnchantMaxWeapon", "0"));
					ENCHANT_MAX_ARMOR = Integer.parseInt(enchantSettings.getProperty("EnchantMaxArmor", "0"));
					ENCHANT_MAX_JEWELRY = Integer.parseInt(enchantSettings.getProperty("EnchantMaxJewelry", "0"));
					ENCHANT_SAFE_MAX = Integer.parseInt(enchantSettings.getProperty("EnchantSafeMax", "3"));
					ENCHANT_SAFE_MAX_FULL = Integer.parseInt(enchantSettings.getProperty("EnchantSafeMaxFull", "4"));
					AUGMENTATION_NG_SKILL_CHANCE = Integer.parseInt(enchantSettings.getProperty("AugmentationNGSkillChance", "15"));
					AUGMENTATION_NG_GLOW_CHANCE = Integer.parseInt(enchantSettings.getProperty("AugmentationNGGlowChance", "0"));
					AUGMENTATION_MID_SKILL_CHANCE = Integer.parseInt(enchantSettings.getProperty("AugmentationMidSkillChance", "30"));
					AUGMENTATION_MID_GLOW_CHANCE = Integer.parseInt(enchantSettings.getProperty("AugmentationMidGlowChance", "40"));
					AUGMENTATION_HIGH_SKILL_CHANCE = Integer.parseInt(enchantSettings.getProperty("AugmentationHighSkillChance", "45"));
					AUGMENTATION_HIGH_GLOW_CHANCE = Integer.parseInt(enchantSettings.getProperty("AugmentationHighGlowChance", "70"));
					AUGMENTATION_TOP_SKILL_CHANCE = Integer.parseInt(enchantSettings.getProperty("AugmentationTopSkillChance", "60"));
					AUGMENTATION_TOP_GLOW_CHANCE = Integer.parseInt(enchantSettings.getProperty("AugmentationTopGlowChance", "100"));
					AUGMENTATION_BASESTAT_CHANCE = Integer.parseInt(enchantSettings.getProperty("AugmentationBaseStatChance", "1"));
					ALLOW_ENCHANT_HERO_WEAPONS = Boolean.parseBoolean(enchantSettings.getProperty("AllowEnchantHeroWeapons", "False"));
				}
			catch (Exception e)
			{
				e.printStackTrace();
				throw new Error("Failed to Load " + ENCHANT_FILE + " File.");
			}
	}
	
	
	//-------------------------------------------------------------------------------------------------------
	// Flood Protector Settings
	//-------------------------------------------------------------------------------------------------------
	public static final FloodProtectorConfig FLOOD_PROTECTOR_USE_ITEM =
		new FloodProtectorConfig("UseItemFloodProtector");
	public static final FloodProtectorConfig FLOOD_PROTECTOR_ROLL_DICE =
		new FloodProtectorConfig("RollDiceFloodProtector");
	public static final FloodProtectorConfig FLOOD_PROTECTOR_FIREWORK =
		new FloodProtectorConfig("FireworkFloodProtector");
	public static final FloodProtectorConfig FLOOD_PROTECTOR_ITEM_PET_SUMMON =
		new FloodProtectorConfig("ItemPetSummonFloodProtector");
	public static final FloodProtectorConfig FLOOD_PROTECTOR_HERO_VOICE =
		new FloodProtectorConfig("HeroVoiceFloodProtector");
	public static final FloodProtectorConfig FLOOD_PROTECTOR_SUBCLASS =
		new FloodProtectorConfig("SubclassFloodProtector");
	public static final FloodProtectorConfig FLOOD_PROTECTOR_DROP_ITEM =
		new FloodProtectorConfig("DropItemFloodProtector");
	public static final FloodProtectorConfig FLOOD_PROTECTOR_SERVER_BYPASS =
		new FloodProtectorConfig("ServerBypassFloodProtector");
	public static final FloodProtectorConfig FLOOD_PROTECTOR_MULTISELL = 
 		new FloodProtectorConfig("MultiSellFloodProtector"); 
	
	//=======================================================================================================
	public static final String FLOOD_PROTECTOR_FILE = "./config/main/flood_protector.properties"; 
	//=======================================================================================================
	
	public static void loadFloodProtectorConfig()
	{
			_log.info("Loading: " + FLOOD_PROTECTOR_FILE);
			InputStream is = null;
				
				// Load FloodProtector Properties file
				try
				{
					Properties security = new Properties();
					is = new FileInputStream(new File(FLOOD_PROTECTOR_FILE));
					security.load(is);
					
					loadFloodProtectorConfigs(security);
					
				}
			catch (Exception e)
			{
				e.printStackTrace();
				throw new Error("Failed to Load " + FLOOD_PROTECTOR_FILE);
			}
	}
	
	//-------------------------------------------------------------------------------------------------------
	// NPC Settings
	//-------------------------------------------------------------------------------------------------------
	public static boolean ANNOUNCE_MAMMON_SPAWN;
	public static boolean ALT_MOB_AGRO_IN_PEACEZONE;
	public static boolean ALT_ATTACKABLE_NPCS;
	public static boolean ALT_GAME_VIEWNPC;
	public static int MAX_DRIFT_RANGE;
	public static boolean DEEPBLUE_DROP_RULES;
	public static boolean SHOW_MONSTER_LVL;
	public static boolean GUARD_ATTACK_AGGRO_MOB;
	public static boolean ALLOW_WYVERN_UPGRADER;
	public static String PET_RENT_NPC;
	public static List<Integer> LIST_PET_RENT_NPC = new FastList<Integer>();
	public static double RAID_HP_REGEN_MULTIPLIER;
	public static double RAID_MP_REGEN_MULTIPLIER;
	public static double RAID_PDEFENCE_MULTIPLIER;
	public static double RAID_MDEFENCE_MULTIPLIER;
	public static double RAID_MINION_RESPAWN_TIMER;
	public static float RAID_MIN_RESPAWN_MULTIPLIER;
	public static float RAID_MAX_RESPAWN_MULTIPLIER;
	public static int INVENTORY_MAXIMUM_PET;
	
 	public static double PET_HP_REGEN_MULTIPLIER; 
 	public static double PET_MP_REGEN_MULTIPLIER;
	
	//=======================================================================================================
	public static final String NPC_CONFIG_FILE = "./config/main/NPC.properties"; 
	//=======================================================================================================
	
	public static void loadNpcConfig()
	{
		_log.info("Loading: " + NPC_CONFIG_FILE);
		InputStream is = null;
	
				// Load NPC Properties file (if exists)
				try
				{
					Properties NPC = new Properties();
					is = new FileInputStream(new File(NPC_CONFIG_FILE));
					NPC.load(is);

					ANNOUNCE_MAMMON_SPAWN = Boolean.parseBoolean(NPC.getProperty("AnnounceMammonSpawn", "False"));
					ALT_MOB_AGRO_IN_PEACEZONE = Boolean.parseBoolean(NPC.getProperty("AltMobAgroInPeaceZone", "True"));
					ALT_ATTACKABLE_NPCS = Boolean.parseBoolean(NPC.getProperty("AltAttackableNpcs", "True"));
					ALT_GAME_VIEWNPC = Boolean.parseBoolean(NPC.getProperty("AltGameViewNpc", "False"));
					MAX_DRIFT_RANGE = Integer.parseInt(NPC.getProperty("MaxDriftRange", "300"));
					DEEPBLUE_DROP_RULES = Boolean.parseBoolean(NPC.getProperty("UseDeepBlueDropRules", "True"));
					SHOW_MONSTER_LVL = Boolean.parseBoolean(NPC.getProperty("ShowMonsterLevel", "False"));
					GUARD_ATTACK_AGGRO_MOB = Boolean.parseBoolean(NPC.getProperty("GuardAttackAggroMob", "False"));
					ALLOW_WYVERN_UPGRADER = Boolean.parseBoolean(NPC.getProperty("AllowWyvernUpgrader", "False"));
					PET_RENT_NPC = NPC.getProperty("ListPetRentNpc", "30827");
					LIST_PET_RENT_NPC = new FastList<Integer>();
					for (String id : PET_RENT_NPC.split(","))
					{
						LIST_PET_RENT_NPC.add(Integer.parseInt(id));
					}
					RAID_HP_REGEN_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidHpRegenMultiplier", "100")) /100;
					RAID_MP_REGEN_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidMpRegenMultiplier", "100")) /100;
					RAID_PDEFENCE_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidPDefenceMultiplier", "100")) /100;
					RAID_MDEFENCE_MULTIPLIER = Double.parseDouble(NPC.getProperty("RaidMDefenceMultiplier", "100")) /100;
					RAID_MIN_RESPAWN_MULTIPLIER = Float.parseFloat(NPC.getProperty("RaidMinRespawnMultiplier", "1.0"));
					RAID_MAX_RESPAWN_MULTIPLIER = Float.parseFloat(NPC.getProperty("RaidMaxRespawnMultiplier", "1.0"));
					RAID_MINION_RESPAWN_TIMER = Integer.parseInt(NPC.getProperty("RaidMinionRespawnTime", "300000"));
					INVENTORY_MAXIMUM_PET = Integer.parseInt(NPC.getProperty("MaximumSlotsForPet", "12"));
				 	PET_HP_REGEN_MULTIPLIER = Double.parseDouble(NPC.getProperty("PetHpRegenMultiplier", "100")) /100; 
				 	PET_MP_REGEN_MULTIPLIER = Double.parseDouble(NPC.getProperty("PetMpRegenMultiplier", "100")) /100; 
				}
			catch (Exception e)
			{
				e.printStackTrace();
				throw new Error("Failed to Load " + NPC_CONFIG_FILE + " File.");
			}
	}
	
	//-------------------------------------------------------------------------------------------------------
	// Skills Settings
	//-------------------------------------------------------------------------------------------------------
	public static boolean ENABLE_MODIFY_SKILL_DURATION;
	public static Map<Integer, Integer> SKILL_DURATION_LIST;
	public static boolean ENABLE_MODIFY_SKILL_REUSE;
	public static Map<Integer, Integer> SKILL_REUSE_LIST;
	public static boolean AUTO_LEARN_SKILLS;
	public static byte BUFFS_MAX_AMOUNT;
	public static byte DANCES_SONGS_MAX_AMOUNT;
	public static boolean AUTO_LEARN_DIVINE_INSPIRATION;
	public static boolean ALT_GAME_CANCEL_BOW;
	public static boolean ALT_GAME_CANCEL_CAST;
	public static boolean EFFECT_CANCELING;
	public static boolean ALT_GAME_MAGICFAILURES;
	public static boolean STORE_SKILL_COOLTIME;
	public static boolean SUBCLASS_STORE_SKILL_COOLTIME;
	public static boolean LIFE_CRYSTAL_NEEDED;
	public static boolean SP_BOOK_NEEDED;
	public static boolean ES_SP_BOOK_NEEDED;
	public static boolean DIVINE_SP_BOOK_NEEDED;
	public static boolean ALT_GAME_SKILL_LEARN;
	public static int ALT_BUFF_TIME;
	public static int ALT_DANCE_SONG_TIME;
	public static int ALT_HERO_TIME;
	public static int ALT_5MIN_TIME;
	public static int ALT_CH_TIME;
	public static float	ALT_MAGES_PHYSICAL_DAMAGE_MULTI;
	public static float	ALT_MAGES_MAGICAL_DAMAGE_MULTI;
	public static float	ALT_FIGHTERS_PHYSICAL_DAMAGE_MULTI;
	public static float	ALT_FIGHTERS_MAGICAL_DAMAGE_MULTI;
	public static float	ALT_PETS_PHYSICAL_DAMAGE_MULTI;
	public static float	ALT_PETS_MAGICAL_DAMAGE_MULTI;
	public static float	ALT_NPC_PHYSICAL_DAMAGE_MULTI;
	public static float	ALT_NPC_MAGICAL_DAMAGE_MULTI;
	public static float	ALT_DAGGER_DMG_VS_HEAVY;		
	public static float	ALT_DAGGER_DMG_VS_ROBE;
	public static float	ALT_DAGGER_DMG_VS_LIGHT;
	public static float	ALT_BOW_DMG_VS_HEAVY;		
	public static float	ALT_BOW_DMG_VS_ROBE;
	public static float	ALT_BOW_DMG_VS_LIGHT;
	public static int MAX_RUN_SPEED;
	public static int MAX_PCRIT_RATE;
	public static int MAX_MCRIT_RATE;
	public static int MAX_PATK_SPEED;
	public static int MAX_MATK_SPEED;
	public static int MAX_EVASION;
	
	//=======================================================================================================
	public static final String SKILLS_FILE = "./config/main/skills.properties"; 
	//=======================================================================================================
	
	public static void loadSkillsConfig()
	{
		_log.info("Loading: " + SKILLS_FILE);
		InputStream is = null;

				// Load skills Properties file (if exists)
				try
				{
					Properties skillsSettings = new Properties();
					is = new FileInputStream(new File(SKILLS_FILE));
					skillsSettings.load(is);
					
					ENABLE_MODIFY_SKILL_DURATION = Boolean.parseBoolean(skillsSettings.getProperty("EnableModifySkillDuration", "false"));

					// Create Map only if enabled
					if (ENABLE_MODIFY_SKILL_DURATION)
					{
						SKILL_DURATION_LIST = new FastMap<Integer, Integer>();
						String[] propertySplit;
						propertySplit = skillsSettings.getProperty("SkillDurationList", "").split(";");
						for (String skill : propertySplit)
						{
							String[] skillSplit = skill.split(",");
							if (skillSplit.length != 2)
								_log.warning(StringUtil.concat("[SkillDurationList]: invalid config property -> SkillDurationList \"", skill, "\""));
							else
							{
								try
								{
									SKILL_DURATION_LIST.put(Integer.parseInt(skillSplit[0]), Integer.parseInt(skillSplit[1]));
								}
								catch (NumberFormatException nfe)
								{
									if (!skill.isEmpty())
									{
										_log.warning(StringUtil.concat("[SkillDurationList]: invalid config property -> SkillList \"", skillSplit[0], "\"", skillSplit[1]));
									}
								}
							}
						}
					}
					ENABLE_MODIFY_SKILL_REUSE = Boolean.parseBoolean(skillsSettings.getProperty("EnableModifySkillReuse", "false"));
					// Create Map only if enabled
					if (ENABLE_MODIFY_SKILL_REUSE)
					{
						SKILL_REUSE_LIST = new FastMap<Integer, Integer>();
						String[] propertySplit;
						propertySplit = skillsSettings.getProperty("SkillReuseList", "").split(";");
						for (String skill : propertySplit)
						{
							String[] skillSplit = skill.split(",");
							if (skillSplit.length != 2)
								_log.warning(StringUtil.concat("[SkillReuseList]: invalid config property -> SkillReuseList \"", skill, "\""));
							else
							{
								try
								{
									SKILL_REUSE_LIST.put(Integer.valueOf(skillSplit[0]), Integer.valueOf(skillSplit[1]));
								}
								catch (NumberFormatException nfe)
								{
									if (!skill.isEmpty())
										_log.warning(StringUtil.concat("[SkillReuseList]: invalid config property -> SkillList \"", skillSplit[0], "\"", skillSplit[1]));
								}
							}
						}
					}

					AUTO_LEARN_SKILLS = Boolean.parseBoolean(skillsSettings.getProperty("AutoLearnSkills", "false"));
					BUFFS_MAX_AMOUNT = Byte.parseByte(skillsSettings.getProperty("MaxBuffsAmount","20"));
					DANCES_SONGS_MAX_AMOUNT = Byte.parseByte(skillsSettings.getProperty("MaxDancesSongsAmount","12"));
					AUTO_LEARN_DIVINE_INSPIRATION = Boolean.parseBoolean(skillsSettings.getProperty("AutoLearnDivineInspiration", "false"));
					ALT_GAME_CANCEL_BOW = skillsSettings.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("bow") || skillsSettings.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("all");
					ALT_GAME_CANCEL_CAST = skillsSettings.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("cast") || skillsSettings.getProperty("AltGameCancelByHit", "Cast").equalsIgnoreCase("all");
					EFFECT_CANCELING = Boolean.parseBoolean(skillsSettings.getProperty("CancelLesserEffect", "True"));
					ALT_GAME_MAGICFAILURES = Boolean.parseBoolean(skillsSettings.getProperty("MagicFailures", "true"));
					STORE_SKILL_COOLTIME = Boolean.parseBoolean(skillsSettings.getProperty("StoreSkillCooltime", "true"));
					SUBCLASS_STORE_SKILL_COOLTIME = Boolean.parseBoolean(skillsSettings.getProperty("SubclassStoreSkillCooltime", "false"));
					LIFE_CRYSTAL_NEEDED = Boolean.parseBoolean(skillsSettings.getProperty("LifeCrystalNeeded", "true"));
					SP_BOOK_NEEDED = Boolean.parseBoolean(skillsSettings.getProperty("SpBookNeeded", "false"));
					ES_SP_BOOK_NEEDED = Boolean.parseBoolean(skillsSettings.getProperty("EnchantSkillSpBookNeeded","true"));
					DIVINE_SP_BOOK_NEEDED = Boolean.parseBoolean(skillsSettings.getProperty("DivineInspirationSpBookNeeded", "true"));
					ALT_GAME_SKILL_LEARN = Boolean.parseBoolean(skillsSettings.getProperty("AltGameSkillLearn", "false"));
					ALT_BUFF_TIME = Integer.parseInt(skillsSettings.getProperty("AltBuffTime", "1"));
					ALT_DANCE_SONG_TIME = Integer.parseInt(skillsSettings.getProperty("AltDanceSongTime", "1"));
					ALT_CH_TIME = Integer.parseInt(skillsSettings.getProperty("AltChTime", "1"));
					ALT_HERO_TIME = Integer.parseInt(skillsSettings.getProperty("AltHeroTime", "1"));
					ALT_5MIN_TIME = Integer.parseInt(skillsSettings.getProperty("Alt5MinTime", "1"));
					ALT_MAGES_PHYSICAL_DAMAGE_MULTI = Float.parseFloat(skillsSettings.getProperty("AltPDamageMages", "1.00"));
					ALT_MAGES_MAGICAL_DAMAGE_MULTI = Float.parseFloat(skillsSettings.getProperty("AltMDamageMages", "1.00"));
					ALT_FIGHTERS_PHYSICAL_DAMAGE_MULTI = Float.parseFloat(skillsSettings.getProperty("AltPDamageFighters", "1.00"));
					ALT_FIGHTERS_MAGICAL_DAMAGE_MULTI = Float.parseFloat(skillsSettings.getProperty("AltMDamageFighters", "1.00"));
					ALT_PETS_PHYSICAL_DAMAGE_MULTI = Float.parseFloat(skillsSettings.getProperty("AltPDamagePets", "1.00"));
					ALT_PETS_MAGICAL_DAMAGE_MULTI = Float.parseFloat(skillsSettings.getProperty("AltMDamagePets", "1.00"));
					ALT_NPC_PHYSICAL_DAMAGE_MULTI = Float.parseFloat(skillsSettings.getProperty("AltPDamageNpc", "1.00"));
					ALT_NPC_MAGICAL_DAMAGE_MULTI = Float.parseFloat(skillsSettings.getProperty("AltMDamageNpc", "1.00"));
					ALT_DAGGER_DMG_VS_HEAVY = Float.parseFloat(skillsSettings.getProperty("DaggerVSHeavy", "1.00"));
					ALT_DAGGER_DMG_VS_ROBE = Float.parseFloat(skillsSettings.getProperty("DaggerVSRobe", "1.00"));
					ALT_DAGGER_DMG_VS_LIGHT = Float.parseFloat(skillsSettings.getProperty("DaggerVSLight", "1.00"));
					ALT_BOW_DMG_VS_HEAVY = Float.parseFloat(skillsSettings.getProperty("ArcherVSHeavy", "1.00"));
					ALT_BOW_DMG_VS_ROBE = Float.parseFloat(skillsSettings.getProperty("ArcherVSRobe", "1.00"));
					ALT_BOW_DMG_VS_LIGHT = Float.parseFloat(skillsSettings.getProperty("ArcherVSLight", "1.00"));
					MAX_RUN_SPEED = Integer.parseInt(skillsSettings.getProperty("MaxRunSpeed", "250"));
					MAX_PCRIT_RATE = Integer.parseInt(skillsSettings.getProperty("MaxPCritRate", "500"));
					MAX_MCRIT_RATE = Integer.parseInt(skillsSettings.getProperty("MaxMCritRate", "200"));
					MAX_PATK_SPEED = Integer.parseInt(skillsSettings.getProperty("MaxPAtkSpeed", "1200"));
					MAX_MATK_SPEED = Integer.parseInt(skillsSettings.getProperty("MaxMAtkSpeed", "1400"));
					MAX_EVASION = Integer.parseInt(skillsSettings.getProperty("MaxEvasion", "200"));
				}
			catch (Exception e)
			{
				e.printStackTrace();
				throw new Error("Failed to Load " + SKILLS_FILE + " File.");
			}
	}
	
	//-------------------------------------------------------------------------------------------------------
	// Clans Settings
	//-------------------------------------------------------------------------------------------------------
	public static int ALT_CLAN_JOIN_DAYS;
	public static int ALT_CLAN_CREATE_DAYS;
	public static int ALT_CLAN_DISSOLVE_DAYS;
	public static int ALT_ALLY_JOIN_DAYS_WHEN_LEAVED;
	public static int ALT_ALLY_JOIN_DAYS_WHEN_DISMISSED;
	public static int ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED;
	public static int ALT_CREATE_ALLY_DAYS_WHEN_DISSOLVED;
	public static int ALT_MAX_NUM_OF_CLANS_IN_ALLY;
	public static int ALT_CLAN_MEMBERS_FOR_WAR;
	public static boolean ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH;
	public static boolean REMOVE_CASTLE_CIRCLETS;
	
	//=======================================================================================================
	public static final String CLANS_FILE = "./config/main/clans.properties"; 
	//=======================================================================================================
	
	public static void loadClansConfig()
	{
		_log.info("Loading: " + CLANS_FILE);
		InputStream is = null;

				// Load clans Properties file (if exists)
				try
				{
					Properties clansSettings = new Properties();
					is = new FileInputStream(new File(CLANS_FILE));
					clansSettings.load(is);
					
					ALT_CLAN_JOIN_DAYS = Integer.parseInt(clansSettings.getProperty("DaysBeforeJoinAClan", "1"));
					ALT_CLAN_CREATE_DAYS = Integer.parseInt(clansSettings.getProperty("DaysBeforeCreateAClan", "10"));
					ALT_CLAN_DISSOLVE_DAYS = Integer.parseInt(clansSettings.getProperty("DaysToPassToDissolveAClan", "7"));
					ALT_ALLY_JOIN_DAYS_WHEN_LEAVED = Integer.parseInt(clansSettings.getProperty("DaysBeforeJoinAllyWhenLeaved", "1"));
					ALT_ALLY_JOIN_DAYS_WHEN_DISMISSED = Integer.parseInt(clansSettings.getProperty("DaysBeforeJoinAllyWhenDismissed", "1"));
					ALT_ACCEPT_CLAN_DAYS_WHEN_DISMISSED = Integer.parseInt(clansSettings.getProperty("DaysBeforeAcceptNewClanWhenDismissed", "1"));
					ALT_CREATE_ALLY_DAYS_WHEN_DISSOLVED = Integer.parseInt(clansSettings.getProperty("DaysBeforeCreateNewAllyWhenDissolved", "10"));
					ALT_MAX_NUM_OF_CLANS_IN_ALLY = Integer.parseInt(clansSettings.getProperty("AltMaxNumOfClansInAlly", "3"));
					ALT_CLAN_MEMBERS_FOR_WAR = Integer.parseInt(clansSettings.getProperty("AltClanMembersForWar", "15"));
					ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH= Boolean.parseBoolean(clansSettings.getProperty("AltMembersCanWithdrawFromClanWH", "false"));
					REMOVE_CASTLE_CIRCLETS = Boolean.parseBoolean(clansSettings.getProperty("RemoveCastleCirclets", "true"));
				}
			catch (Exception e)
			{
				e.printStackTrace();
				throw new Error("Failed to Load " + CLANS_FILE + " File.");
			}
	}
	
	//-------------------------------------------------------------------------------------------------------
	// Olympiad Settings
	//-------------------------------------------------------------------------------------------------------
	public static int ALT_OLY_START_TIME;
	public static int ALT_OLY_MIN;
	public static long ALT_OLY_CPERIOD;
	public static long ALT_OLY_BATTLE;
	public static long ALT_OLY_WPERIOD;
	public static long ALT_OLY_VPERIOD;
	public static int ALT_OLY_CLASSED;
	public static int ALT_OLY_NONCLASSED;
	public static int ALT_OLY_REG_DISPLAY;
	public static int ALT_OLY_BATTLE_REWARD_ITEM;
	public static int ALT_OLY_CLASSED_RITEM_C;
	public static int ALT_OLY_NONCLASSED_RITEM_C;
	public static int ALT_OLY_COMP_RITEM;
	public static int ALT_OLY_GP_PER_POINT;
	public static int ALT_OLY_HERO_POINTS;
 	public static int ALT_OLY_RANK1_POINTS; 
 	public static int ALT_OLY_RANK2_POINTS; 
 	public static int ALT_OLY_RANK3_POINTS; 
 	public static int ALT_OLY_RANK4_POINTS; 
 	public static int ALT_OLY_RANK5_POINTS;
	public static boolean ALT_OLY_LOG_FIGHTS;
	public static boolean ALT_OLY_SHOW_MONTHLY_WINNERS;
	public static boolean ALT_OLY_ANNOUNCE_GAMES;
	public static List<Integer> LIST_OLY_RESTRICTED_ITEMS = new FastList<Integer>();
	public static int ALT_OLY_ENCHANT_LIMIT;
	
	//=======================================================================================================
	public static final String OLYMPIAD_FILE = "./config/main/olympiad.properties"; 
	//=======================================================================================================
	
	public static void loadOlympiadConfig()
	{
		_log.info("Loading: " + OLYMPIAD_FILE);
		InputStream is = null;

				// Load Olympiad Properties file (if exists)
				try
				{
					Properties olympiadSettings = new Properties();
					is = new FileInputStream(new File(OLYMPIAD_FILE));
					olympiadSettings.load(is);

					ALT_OLY_START_TIME = Integer.parseInt(olympiadSettings.getProperty("AltOlyStartTime", "18"));
					ALT_OLY_MIN = Integer.parseInt(olympiadSettings.getProperty("AltOlyMin","00"));
					ALT_OLY_CPERIOD = Long.parseLong(olympiadSettings.getProperty("AltOlyCPeriod","21600000"));
					ALT_OLY_BATTLE = Long.parseLong(olympiadSettings.getProperty("AltOlyBattle","360000"));
					ALT_OLY_WPERIOD = Long.parseLong(olympiadSettings.getProperty("AltOlyWPeriod","604800000"));
					ALT_OLY_VPERIOD = Long.parseLong(olympiadSettings.getProperty("AltOlyVPeriod","86400000"));
					ALT_OLY_CLASSED = Integer.parseInt(olympiadSettings.getProperty("AltOlyClassedParticipants","5"));
					ALT_OLY_NONCLASSED = Integer.parseInt(olympiadSettings.getProperty("AltOlyNonClassedParticipants","9"));
					ALT_OLY_REG_DISPLAY = Integer.parseInt(olympiadSettings.getProperty("AltOlyRegistrationDisplayNumber","100"));
					ALT_OLY_BATTLE_REWARD_ITEM = Integer.parseInt(olympiadSettings.getProperty("AltOlyBattleRewItem","13722"));
					ALT_OLY_CLASSED_RITEM_C = Integer.parseInt(olympiadSettings.getProperty("AltOlyClassedRewItemCount","50"));
					ALT_OLY_NONCLASSED_RITEM_C = Integer.parseInt(olympiadSettings.getProperty("AltOlyNonClassedRewItemCount","30"));
					ALT_OLY_COMP_RITEM = Integer.parseInt(olympiadSettings.getProperty("AltOlyCompRewItem","6651"));
					ALT_OLY_GP_PER_POINT = Integer.parseInt(olympiadSettings.getProperty("AltOlyGPPerPoint","1000"));
				 	ALT_OLY_HERO_POINTS = Integer.parseInt(olympiadSettings.getProperty("AltOlyHeroPoints","180")); 
				 	ALT_OLY_RANK1_POINTS = Integer.parseInt(olympiadSettings.getProperty("AltOlyRank1Points","120")); 
				 	ALT_OLY_RANK2_POINTS = Integer.parseInt(olympiadSettings.getProperty("AltOlyRank2Points","80")); 
				 	ALT_OLY_RANK3_POINTS = Integer.parseInt(olympiadSettings.getProperty("AltOlyRank3Points","55")); 
				 	ALT_OLY_RANK4_POINTS = Integer.parseInt(olympiadSettings.getProperty("AltOlyRank4Points","35")); 
				 	ALT_OLY_RANK5_POINTS = Integer.parseInt(olympiadSettings.getProperty("AltOlyRank5Points","20"));
					ALT_OLY_HERO_POINTS = Integer.parseInt(olympiadSettings.getProperty("AltOlyHeroPoints","300"));
					ALT_OLY_LOG_FIGHTS = Boolean.parseBoolean(olympiadSettings.getProperty("AlyOlyLogFights","false"));
					ALT_OLY_SHOW_MONTHLY_WINNERS = Boolean.parseBoolean(olympiadSettings.getProperty("AltOlyShowMonthlyWinners","true"));
					ALT_OLY_ANNOUNCE_GAMES = Boolean.parseBoolean(olympiadSettings.getProperty("AltOlyAnnounceGames","true"));
					LIST_OLY_RESTRICTED_ITEMS = new FastList<Integer>();
					for (String id : olympiadSettings.getProperty("AltOlyRestrictedItems","0").split(","))
					{
						LIST_OLY_RESTRICTED_ITEMS.add(Integer.parseInt(id));
					}
					ALT_OLY_ENCHANT_LIMIT = Integer.parseInt(olympiadSettings.getProperty("AltOlyEnchantLimit","-1"));
				}
			catch (Exception e)
			{
				e.printStackTrace();
				throw new Error("Failed to Load " + OLYMPIAD_FILE + " file.");
			}
	}
	
	//-------------------------------------------------------------------------------------------------------
	// Lottery Settings
	//-------------------------------------------------------------------------------------------------------
	public static boolean ALLOW_LOTTERY;
	public static long ALT_LOTTERY_PRIZE;
	public static long ALT_LOTTERY_TICKET_PRICE;
	public static float ALT_LOTTERY_5_NUMBER_RATE;
	public static float ALT_LOTTERY_4_NUMBER_RATE;
	public static float ALT_LOTTERY_3_NUMBER_RATE;
	public static long ALT_LOTTERY_2_AND_1_NUMBER_PRIZE;
	
	//=======================================================================================================
	public static final String LOTTERY_FILE = "./config/main/lottery.properties"; 
	//=======================================================================================================
	
	public static void loadLotteryConfig()
	{
		_log.info("Loading: " + LOTTERY_FILE);
		InputStream is = null;

				// Load Lottery Properties file (if exists)
				try
				{
					Properties lotterySettings = new Properties();
					is = new FileInputStream(new File(LOTTERY_FILE));
					lotterySettings.load(is);

					ALLOW_LOTTERY = Boolean.parseBoolean(lotterySettings.getProperty("AllowLottery","false"));
					ALT_LOTTERY_PRIZE = Long.parseLong(lotterySettings.getProperty("AltLotteryPrize","50000"));
					ALT_LOTTERY_TICKET_PRICE = Long.parseLong(lotterySettings.getProperty("AltLotteryTicketPrice","2000"));
					ALT_LOTTERY_5_NUMBER_RATE = Float.parseFloat(lotterySettings.getProperty("AltLottery5NumberRate","0.6"));
					ALT_LOTTERY_4_NUMBER_RATE = Float.parseFloat(lotterySettings.getProperty("AltLottery4NumberRate","0.2"));
					ALT_LOTTERY_3_NUMBER_RATE = Float.parseFloat(lotterySettings.getProperty("AltLottery3NumberRate","0.2"));
					ALT_LOTTERY_2_AND_1_NUMBER_PRIZE = Long.parseLong(lotterySettings.getProperty("AltLottery2and1NumberPrize","200"));
				}
			catch (Exception e)
			{
				e.printStackTrace();
				throw new Error("Failed to Load " + LOTTERY_FILE + " file.");
			}
	}
	
	//-------------------------------------------------------------------------------------------------------
	// Manor Settings
	//-------------------------------------------------------------------------------------------------------
	public static boolean ALLOW_MANOR;
	public static int ALT_MANOR_REFRESH_TIME;
	public static int ALT_MANOR_REFRESH_MIN;
	public static int ALT_MANOR_APPROVE_TIME;
	public static int ALT_MANOR_APPROVE_MIN;
	public static int ALT_MANOR_MAINTENANCE_PERIOD;
	public static boolean ALT_MANOR_SAVE_ALL_ACTIONS;
	public static int ALT_MANOR_SAVE_PERIOD_RATE;
	
	//=======================================================================================================
	public static final String MANOR_FILE = "./config/main/manor.properties"; 
	//=======================================================================================================
	
	public static void loadManorConfig()
	{
		_log.info("Loading: " + MANOR_FILE);
		InputStream is = null;

				// Load Manor Properties file (if exists)
				try
				{
					Properties manorSettings = new Properties();
					is = new FileInputStream(new File(MANOR_FILE));
					manorSettings.load(is);

					ALLOW_MANOR = Boolean.parseBoolean(manorSettings.getProperty("AllowManor","false"));
					ALT_MANOR_REFRESH_TIME = Integer.parseInt(manorSettings.getProperty("AltManorRefreshTime","20"));
					ALT_MANOR_REFRESH_MIN = Integer.parseInt(manorSettings.getProperty("AltManorRefreshMin","00"));
					ALT_MANOR_APPROVE_TIME = Integer.parseInt(manorSettings.getProperty("AltManorApproveTime","6"));
					ALT_MANOR_APPROVE_MIN = Integer.parseInt(manorSettings.getProperty("AltManorApproveMin","00"));
					ALT_MANOR_MAINTENANCE_PERIOD = Integer.parseInt(manorSettings.getProperty("AltManorMaintenancePeriod","360000"));
					ALT_MANOR_SAVE_ALL_ACTIONS = Boolean.parseBoolean(manorSettings.getProperty("AltManorSaveAllActions","false"));
					ALT_MANOR_SAVE_PERIOD_RATE = Integer.parseInt(manorSettings.getProperty("AltManorSavePeriodRate","2"));
				}
			catch (Exception e)
			{
				e.printStackTrace();
				throw new Error("Failed to Load " + MANOR_FILE + " file.");
			}
	}
	
	//-------------------------------------------------------------------------------------------------------
	// Feature Settings
	//-------------------------------------------------------------------------------------------------------
	public static int TAKE_FORT_POINTS;
	public static int LOOSE_FORT_POINTS;
	public static int TAKE_CASTLE_POINTS;
	public static int LOOSE_CASTLE_POINTS;
	public static int CASTLE_DEFENDED_POINTS;
	public static int FESTIVAL_WIN_POINTS;
	public static int HERO_POINTS;
	public static int ROYAL_GUARD_COST;
	public static int KNIGHT_UNIT_COST;
	public static int KNIGHT_REINFORCE_COST;
	public static int BALLISTA_POINTS;
	public static int REPUTATION_SCORE_PER_KILL;
	public static int JOIN_ACADEMY_MIN_REP_SCORE;
	public static int JOIN_ACADEMY_MAX_REP_SCORE;
	public static int RAID_RANKING_1ST;
	public static int RAID_RANKING_2ND;
	public static int RAID_RANKING_3RD;
	public static int RAID_RANKING_4TH;
	public static int RAID_RANKING_5TH;
	public static int RAID_RANKING_6TH;
	public static int RAID_RANKING_7TH;
	public static int RAID_RANKING_8TH;
	public static int RAID_RANKING_9TH;
	public static int RAID_RANKING_10TH;
	public static int RAID_RANKING_UP_TO_50TH;
	public static int RAID_RANKING_UP_TO_100TH;
	public static int CLAN_LEVEL_6_COST;
	public static int CLAN_LEVEL_7_COST;
	public static int CLAN_LEVEL_8_COST;
	public static int CLAN_LEVEL_9_COST;
	public static int CLAN_LEVEL_10_COST;
	
	//--------------------------------------------------
	// Castle Settings
	//--------------------------------------------------
	public static long CS_TELE_FEE_RATIO;
	public static int CS_TELE1_FEE;
	public static int CS_TELE2_FEE;
	public static long CS_MPREG_FEE_RATIO;
	public static int CS_MPREG1_FEE;
	public static int CS_MPREG2_FEE;
	public static int CS_MPREG3_FEE;
	public static int CS_MPREG4_FEE;
	public static long CS_HPREG_FEE_RATIO;
	public static int CS_HPREG1_FEE;
	public static int CS_HPREG2_FEE;
	public static int CS_HPREG3_FEE;
	public static int CS_HPREG4_FEE;
	public static int CS_HPREG5_FEE;
	public static long CS_EXPREG_FEE_RATIO;
	public static int CS_EXPREG1_FEE;
	public static int CS_EXPREG2_FEE;
	public static int CS_EXPREG3_FEE;
	public static int CS_EXPREG4_FEE;
	public static long CS_SUPPORT_FEE_RATIO;
	public static int CS_SUPPORT1_FEE;
	public static int CS_SUPPORT2_FEE;
	public static int CS_SUPPORT3_FEE;
	public static int CS_SUPPORT4_FEE;
	public static List<String> CL_SET_SIEGE_TIME_LIST;
	public static List<Integer> SIEGE_HOUR_LIST_MORNING;
	public static List<Integer> SIEGE_HOUR_LIST_AFTERNOON;
	
	//--------------------------------------------------
	// ClanHall Settings
	//--------------------------------------------------
	public static long CH_TELE_FEE_RATIO;
	public static int CH_TELE1_FEE;
	public static int CH_TELE2_FEE;
	public static long CH_ITEM_FEE_RATIO;
	public static int CH_ITEM1_FEE;
	public static int CH_ITEM2_FEE;
	public static int CH_ITEM3_FEE;
	public static long CH_MPREG_FEE_RATIO;
	public static int CH_MPREG1_FEE;
	public static int CH_MPREG2_FEE;
	public static int CH_MPREG3_FEE;
	public static int CH_MPREG4_FEE;
	public static int CH_MPREG5_FEE;
	public static long CH_HPREG_FEE_RATIO;
	public static int CH_HPREG1_FEE;
	public static int CH_HPREG2_FEE;
	public static int CH_HPREG3_FEE;
	public static int CH_HPREG4_FEE;
	public static int CH_HPREG5_FEE;
	public static int CH_HPREG6_FEE;
	public static int CH_HPREG7_FEE;
	public static int CH_HPREG8_FEE;
	public static int CH_HPREG9_FEE;
	public static int CH_HPREG10_FEE;
	public static int CH_HPREG11_FEE;
	public static int CH_HPREG12_FEE;
	public static int CH_HPREG13_FEE;
	public static long CH_EXPREG_FEE_RATIO;
	public static int CH_EXPREG1_FEE;
	public static int CH_EXPREG2_FEE;
	public static int CH_EXPREG3_FEE;
	public static int CH_EXPREG4_FEE;
	public static int CH_EXPREG5_FEE;
	public static int CH_EXPREG6_FEE;
	public static int CH_EXPREG7_FEE;
	public static long CH_SUPPORT_FEE_RATIO;
	public static int CH_SUPPORT1_FEE;
	public static int CH_SUPPORT2_FEE;
	public static int CH_SUPPORT3_FEE;
	public static int CH_SUPPORT4_FEE;
	public static int CH_SUPPORT5_FEE;
	public static int CH_SUPPORT6_FEE;
	public static int CH_SUPPORT7_FEE;
	public static int CH_SUPPORT8_FEE;
	public static long CH_CURTAIN_FEE_RATIO;
	public static int CH_CURTAIN1_FEE;
	public static int CH_CURTAIN2_FEE;
	public static long CH_FRONT_FEE_RATIO;
	public static int CH_FRONT1_FEE;
	public static int CH_FRONT2_FEE;


	//--------------------------------------------------
	// Fortress Settings
	//--------------------------------------------------
	public static long FS_TELE_FEE_RATIO;
	public static int FS_TELE1_FEE;
	public static int FS_TELE2_FEE;
	public static long FS_MPREG_FEE_RATIO;
	public static int FS_MPREG1_FEE;
	public static int FS_MPREG2_FEE;
	public static long FS_HPREG_FEE_RATIO;
	public static int FS_HPREG1_FEE;
	public static int FS_HPREG2_FEE;
	public static long FS_EXPREG_FEE_RATIO;
	public static int FS_EXPREG1_FEE;
	public static int FS_EXPREG2_FEE;
	public static long FS_SUPPORT_FEE_RATIO;
	public static int FS_SUPPORT1_FEE;
	public static int FS_SUPPORT2_FEE;
 	public static int FS_BLOOD_OATH_COUNT; 
 	public static int FS_BLOOD_OATH_FRQ; 
	
	//--------------------------------------------------
	// Seven Signs Settings
	//--------------------------------------------------
	public static boolean ALT_GAME_CASTLE_DAWN;
	public static boolean ALT_GAME_CASTLE_DUSK;
	public static boolean ALT_GAME_REQUIRE_CLAN_CASTLE;
	public static int ALT_FESTIVAL_MIN_PLAYER;
	public static int ALT_MAXIMUM_PLAYER_CONTRIB;
	public static long ALT_FESTIVAL_MANAGER_START;
	public static long ALT_FESTIVAL_LENGTH;
	public static long ALT_FESTIVAL_CYCLE_LENGTH;
	public static long ALT_FESTIVAL_FIRST_SPAWN;
	public static long ALT_FESTIVAL_FIRST_SWARM;
	public static long ALT_FESTIVAL_SECOND_SPAWN;
	public static long ALT_FESTIVAL_SECOND_SWARM;
	public static long ALT_FESTIVAL_CHEST_SPAWN;
	public static double ALT_SIEGE_DAWN_GATES_PDEF_MULT;
	public static double ALT_SIEGE_DUSK_GATES_PDEF_MULT;
	public static double ALT_SIEGE_DAWN_GATES_MDEF_MULT;
	public static double ALT_SIEGE_DUSK_GATES_MDEF_MULT;

	//=======================================================================================================
	public static final String FEATURE_CONFIG_FILE = "./config/main/Feature.properties"; 
	//=======================================================================================================
	
	public static void loadFeatureConfig()
	{
		_log.info("Loading: " + FEATURE_CONFIG_FILE);
		InputStream is = null;

				// Load Feature Properties file (if exists)
				try
				{
					Properties Feature = new Properties();
					is = new FileInputStream(new File(FEATURE_CONFIG_FILE));
					Feature.load(is);

					CH_TELE_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallTeleportFunctionFeeRatio", "604800000"));
					CH_TELE1_FEE = Integer.parseInt(Feature.getProperty("ClanHallTeleportFunctionFeeLvl1", "7000"));
					CH_TELE2_FEE = Integer.parseInt(Feature.getProperty("ClanHallTeleportFunctionFeeLvl2", "14000"));
					CH_SUPPORT_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallSupportFunctionFeeRatio", "86400000"));
					CH_SUPPORT1_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl1", "2500"));
					CH_SUPPORT2_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl2", "5000"));
					CH_SUPPORT3_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl3", "7000"));
					CH_SUPPORT4_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl4", "11000"));
					CH_SUPPORT5_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl5", "21000"));
					CH_SUPPORT6_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl6", "36000"));
					CH_SUPPORT7_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl7", "37000"));
					CH_SUPPORT8_FEE = Integer.parseInt(Feature.getProperty("ClanHallSupportFeeLvl8", "52000"));
					CH_MPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallMpRegenerationFunctionFeeRatio", "86400000"));
					CH_MPREG1_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl1", "2000"));
					CH_MPREG2_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl2", "3750"));
					CH_MPREG3_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl3", "6500"));
					CH_MPREG4_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl4", "13750"));
					CH_MPREG5_FEE = Integer.parseInt(Feature.getProperty("ClanHallMpRegenerationFeeLvl5", "20000"));
					CH_HPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallHpRegenerationFunctionFeeRatio", "86400000"));
					CH_HPREG1_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl1", "700"));
					CH_HPREG2_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl2", "800"));
					CH_HPREG3_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl3", "1000"));
					CH_HPREG4_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl4", "1166"));
					CH_HPREG5_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl5", "1500"));
					CH_HPREG6_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl6", "1750"));
					CH_HPREG7_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl7", "2000"));
					CH_HPREG8_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl8", "2250"));
					CH_HPREG9_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl9", "2500"));
					CH_HPREG10_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl10", "3250"));
					CH_HPREG11_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl11", "3270"));
					CH_HPREG12_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl12", "4250"));
					CH_HPREG13_FEE = Integer.parseInt(Feature.getProperty("ClanHallHpRegenerationFeeLvl13", "5166"));
					CH_EXPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallExpRegenerationFunctionFeeRatio", "86400000"));
					CH_EXPREG1_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl1", "3000"));
					CH_EXPREG2_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl2", "6000"));
					CH_EXPREG3_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl3", "9000"));
					CH_EXPREG4_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl4", "15000"));
					CH_EXPREG5_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl5", "21000"));
					CH_EXPREG6_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl6", "23330"));
					CH_EXPREG7_FEE = Integer.parseInt(Feature.getProperty("ClanHallExpRegenerationFeeLvl7", "30000"));
					CH_ITEM_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallItemCreationFunctionFeeRatio", "86400000"));
					CH_ITEM1_FEE = Integer.parseInt(Feature.getProperty("ClanHallItemCreationFunctionFeeLvl1", "30000"));
					CH_ITEM2_FEE = Integer.parseInt(Feature.getProperty("ClanHallItemCreationFunctionFeeLvl2", "70000"));
					CH_ITEM3_FEE = Integer.parseInt(Feature.getProperty("ClanHallItemCreationFunctionFeeLvl3", "140000"));
					CH_CURTAIN_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallCurtainFunctionFeeRatio", "604800000"));
					CH_CURTAIN1_FEE = Integer.parseInt(Feature.getProperty("ClanHallCurtainFunctionFeeLvl1", "2000"));
					CH_CURTAIN2_FEE = Integer.parseInt(Feature.getProperty("ClanHallCurtainFunctionFeeLvl2", "2500"));
					CH_FRONT_FEE_RATIO = Long.parseLong(Feature.getProperty("ClanHallFrontPlatformFunctionFeeRatio", "259200000"));
					CH_FRONT1_FEE = Integer.parseInt(Feature.getProperty("ClanHallFrontPlatformFunctionFeeLvl1", "1300"));
					CH_FRONT2_FEE = Integer.parseInt(Feature.getProperty("ClanHallFrontPlatformFunctionFeeLvl2", "4000"));


					CL_SET_SIEGE_TIME_LIST = new FastList<String>();
					SIEGE_HOUR_LIST_MORNING = new FastList<Integer>();
					SIEGE_HOUR_LIST_AFTERNOON = new FastList<Integer>();
					String[] sstl = Feature.getProperty("CLSetSiegeTimeList", "").split(",");
					if (sstl.length != 0)
					{
						boolean isHour = false;
						for (String st : sstl)
						{
							if (st.equalsIgnoreCase("day") || st.equalsIgnoreCase("hour") || st.equalsIgnoreCase("minute"))
							{
								if (st.equalsIgnoreCase("hour")) isHour = true;
								CL_SET_SIEGE_TIME_LIST.add(st.toLowerCase());
							}
							else
							{
								_log.warning(StringUtil.concat("[CLSetSiegeTimeList]: invalid config property -> CLSetSiegeTimeList \"", st, "\""));
							}
						}
						if (isHour)
						{
							String[] shl = Feature.getProperty("SiegeHourList", "").split(",");
							for (String st : shl)
							{
								if (!st.equalsIgnoreCase(""))
								{
									int val = Integer.valueOf(st);
									if (val > 23 || val < 0)
										_log.warning(StringUtil.concat("[SiegeHourList]: invalid config property -> SiegeHourList \"", st, "\""));
									else if (val < 12)
										SIEGE_HOUR_LIST_MORNING.add(val);
									else
									{
										val -= 12;
										SIEGE_HOUR_LIST_AFTERNOON.add(val);
									}
								}
							}
							if (Config.SIEGE_HOUR_LIST_AFTERNOON.isEmpty() && Config.SIEGE_HOUR_LIST_AFTERNOON.isEmpty())
							{
								_log.warning("[SiegeHourList]: invalid config property -> SiegeHourList is empty");
								CL_SET_SIEGE_TIME_LIST.remove("hour");
							}
						}
					}
					CS_TELE_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleTeleportFunctionFeeRatio", "604800000"));
					CS_TELE1_FEE = Integer.parseInt(Feature.getProperty("CastleTeleportFunctionFeeLvl1", "7000"));
					CS_TELE2_FEE = Integer.parseInt(Feature.getProperty("CastleTeleportFunctionFeeLvl2", "14000"));
					CS_SUPPORT_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleSupportFunctionFeeRatio", "86400000"));
					CS_SUPPORT1_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl1", "7000"));
					CS_SUPPORT2_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl2", "21000"));
					CS_SUPPORT3_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl3", "37000"));
					CS_SUPPORT4_FEE = Integer.parseInt(Feature.getProperty("CastleSupportFeeLvl4", "52000"));
					CS_MPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleMpRegenerationFunctionFeeRatio", "86400000"));
					CS_MPREG1_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl1", "2000"));
					CS_MPREG2_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl2", "6500"));
					CS_MPREG3_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl3", "13750"));
					CS_MPREG4_FEE = Integer.parseInt(Feature.getProperty("CastleMpRegenerationFeeLvl4", "20000"));
					CS_HPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleHpRegenerationFunctionFeeRatio", "86400000"));
					CS_HPREG1_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl1", "1000"));
					CS_HPREG2_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl2", "1500"));
					CS_HPREG3_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl3", "2250"));
					CS_HPREG4_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl4", "3270"));
					CS_HPREG5_FEE = Integer.parseInt(Feature.getProperty("CastleHpRegenerationFeeLvl5", "5166"));
					CS_EXPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("CastleExpRegenerationFunctionFeeRatio", "86400000"));
					CS_EXPREG1_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl1", "9000"));
					CS_EXPREG2_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl2", "15000"));
					CS_EXPREG3_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl3", "21000"));
					CS_EXPREG4_FEE = Integer.parseInt(Feature.getProperty("CastleExpRegenerationFeeLvl4", "30000"));

					FS_TELE_FEE_RATIO = Long.parseLong(Feature.getProperty("FortressTeleportFunctionFeeRatio", "604800000"));
					FS_TELE1_FEE = Integer.parseInt(Feature.getProperty("FortressTeleportFunctionFeeLvl1", "1000"));
					FS_TELE2_FEE = Integer.parseInt(Feature.getProperty("FortressTeleportFunctionFeeLvl2", "10000"));
					FS_SUPPORT_FEE_RATIO = Long.parseLong(Feature.getProperty("FortressSupportFunctionFeeRatio", "86400000"));
					FS_SUPPORT1_FEE = Integer.parseInt(Feature.getProperty("FortressSupportFeeLvl1", "7000"));
					FS_SUPPORT2_FEE = Integer.parseInt(Feature.getProperty("FortressSupportFeeLvl2", "17000"));
					FS_MPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("FortressMpRegenerationFunctionFeeRatio", "86400000"));
					FS_MPREG1_FEE = Integer.parseInt(Feature.getProperty("FortressMpRegenerationFeeLvl1", "6500"));
					FS_MPREG2_FEE = Integer.parseInt(Feature.getProperty("FortressMpRegenerationFeeLvl2", "9300"));
					FS_HPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("FortressHpRegenerationFunctionFeeRatio", "86400000"));
					FS_HPREG1_FEE = Integer.parseInt(Feature.getProperty("FortressHpRegenerationFeeLvl1", "2000"));
					FS_HPREG2_FEE = Integer.parseInt(Feature.getProperty("FortressHpRegenerationFeeLvl2", "3500"));
					FS_EXPREG_FEE_RATIO = Long.parseLong(Feature.getProperty("FortressExpRegenerationFunctionFeeRatio", "86400000"));
					FS_EXPREG1_FEE = Integer.parseInt(Feature.getProperty("FortressExpRegenerationFeeLvl1", "9000"));
					FS_EXPREG2_FEE = Integer.parseInt(Feature.getProperty("FortressExpRegenerationFeeLvl2", "10000"));
				 	FS_BLOOD_OATH_COUNT = Integer.parseInt(Feature.getProperty("FortressBloodOathCount", "1")); 
				 	FS_BLOOD_OATH_FRQ = Integer.parseInt(Feature.getProperty("FortressBloodOathFrequency", "360"));
					
					ALT_GAME_CASTLE_DAWN = Boolean.parseBoolean(Feature.getProperty("AltCastleForDawn", "True"));
					ALT_GAME_CASTLE_DUSK = Boolean.parseBoolean(Feature.getProperty("AltCastleForDusk", "True"));
					ALT_GAME_REQUIRE_CLAN_CASTLE = Boolean.parseBoolean(Feature.getProperty("AltRequireClanCastle", "False"));
					ALT_FESTIVAL_MIN_PLAYER = Integer.parseInt(Feature.getProperty("AltFestivalMinPlayer", "5"));
					ALT_MAXIMUM_PLAYER_CONTRIB = Integer.parseInt(Feature.getProperty("AltMaxPlayerContrib", "1000000"));
					ALT_FESTIVAL_MANAGER_START = Long.parseLong(Feature.getProperty("AltFestivalManagerStart", "120000"));
					ALT_FESTIVAL_LENGTH = Long.parseLong(Feature.getProperty("AltFestivalLength", "1080000"));
					ALT_FESTIVAL_CYCLE_LENGTH = Long.parseLong(Feature.getProperty("AltFestivalCycleLength", "2280000"));
					ALT_FESTIVAL_FIRST_SPAWN = Long.parseLong(Feature.getProperty("AltFestivalFirstSpawn", "120000"));
					ALT_FESTIVAL_FIRST_SWARM = Long.parseLong(Feature.getProperty("AltFestivalFirstSwarm", "300000"));
					ALT_FESTIVAL_SECOND_SPAWN = Long.parseLong(Feature.getProperty("AltFestivalSecondSpawn", "540000"));
					ALT_FESTIVAL_SECOND_SWARM = Long.parseLong(Feature.getProperty("AltFestivalSecondSwarm", "720000"));
					ALT_FESTIVAL_CHEST_SPAWN = Long.parseLong(Feature.getProperty("AltFestivalChestSpawn", "900000"));
					ALT_SIEGE_DAWN_GATES_PDEF_MULT = Double.parseDouble(Feature.getProperty("AltDawnGatesPdefMult", "1.1"));
					ALT_SIEGE_DUSK_GATES_PDEF_MULT = Double.parseDouble(Feature.getProperty("AltDuskGatesPdefMult", "0.8"));
					ALT_SIEGE_DAWN_GATES_MDEF_MULT = Double.parseDouble(Feature.getProperty("AltDawnGatesMdefMult", "1.1"));
					ALT_SIEGE_DUSK_GATES_MDEF_MULT = Double.parseDouble(Feature.getProperty("AltDuskGatesMdefMult", "0.8"));

					TAKE_FORT_POINTS = Integer.parseInt(Feature.getProperty("TakeFortPoints", "200"));
					LOOSE_FORT_POINTS = Integer.parseInt(Feature.getProperty("LooseFortPoints", "400"));
					TAKE_CASTLE_POINTS = Integer.parseInt(Feature.getProperty("TakeCastlePoints", "1500"));
					LOOSE_CASTLE_POINTS = Integer.parseInt(Feature.getProperty("LooseCastlePoints", "3000"));
					CASTLE_DEFENDED_POINTS = Integer.parseInt(Feature.getProperty("CastleDefendedPoints", "750"));
					FESTIVAL_WIN_POINTS = Integer.parseInt(Feature.getProperty("FestivalOfDarknessWin", "200"));
					HERO_POINTS = Integer.parseInt(Feature.getProperty("HeroPoints", "1000"));
					ROYAL_GUARD_COST = Integer.parseInt(Feature.getProperty("CreateRoyalGuardCost", "5000"));
					KNIGHT_UNIT_COST = Integer.parseInt(Feature.getProperty("CreateKnightUnitCost", "10000"));
					KNIGHT_REINFORCE_COST = Integer.parseInt(Feature.getProperty("ReinforceKnightUnitCost", "5000"));
					BALLISTA_POINTS = Integer.parseInt(Feature.getProperty("KillBallistaPoints", "30"));
					REPUTATION_SCORE_PER_KILL = Integer.parseInt(Feature.getProperty("ReputationScorePerKill", "1"));
					JOIN_ACADEMY_MIN_REP_SCORE = Integer.parseInt(Feature.getProperty("CompleteAcademyMinPoints", "190"));
					JOIN_ACADEMY_MAX_REP_SCORE = Integer.parseInt(Feature.getProperty("CompleteAcademyMaxPoints", "650"));
					RAID_RANKING_1ST = Integer.parseInt(Feature.getProperty("1stRaidRankingPoints", "1250"));
					RAID_RANKING_2ND = Integer.parseInt(Feature.getProperty("2ndRaidRankingPoints", "900"));
					RAID_RANKING_3RD = Integer.parseInt(Feature.getProperty("3rdRaidRankingPoints", "700"));
					RAID_RANKING_4TH = Integer.parseInt(Feature.getProperty("4thRaidRankingPoints", "600"));
					RAID_RANKING_5TH = Integer.parseInt(Feature.getProperty("5thRaidRankingPoints", "450"));
					RAID_RANKING_6TH = Integer.parseInt(Feature.getProperty("6thRaidRankingPoints", "350"));
					RAID_RANKING_7TH = Integer.parseInt(Feature.getProperty("7thRaidRankingPoints", "300"));
					RAID_RANKING_8TH = Integer.parseInt(Feature.getProperty("8thRaidRankingPoints", "200"));
					RAID_RANKING_9TH = Integer.parseInt(Feature.getProperty("9thRaidRankingPoints", "150"));
					RAID_RANKING_10TH = Integer.parseInt(Feature.getProperty("10thRaidRankingPoints", "100"));
					RAID_RANKING_UP_TO_50TH = Integer.parseInt(Feature.getProperty("UpTo50thRaidRankingPoints", "25"));
					RAID_RANKING_UP_TO_100TH = Integer.parseInt(Feature.getProperty("UpTo100thRaidRankingPoints", "12"));
					CLAN_LEVEL_6_COST = Integer.parseInt(Feature.getProperty("ClanLevel6Cost", "10000"));
					CLAN_LEVEL_7_COST = Integer.parseInt(Feature.getProperty("ClanLevel7Cost", "20000"));
					CLAN_LEVEL_8_COST = Integer.parseInt(Feature.getProperty("ClanLevel8Cost", "40000"));
					CLAN_LEVEL_9_COST = Integer.parseInt(Feature.getProperty("ClanLevel9Cost", "40000"));
					CLAN_LEVEL_10_COST = Integer.parseInt(Feature.getProperty("ClanLevel10Cost", "40000"));
				}
			catch (Exception e)
			{
				e.printStackTrace();
				throw new Error("Failed to Load " + FEATURE_CONFIG_FILE + " File.");
			}
	}
	
	//-------------------------------------------------------------------------------------------------------
	// Alt Settings
	//-------------------------------------------------------------------------------------------------------
	public static boolean ALT_GAME_DELEVEL;
	public static double ALT_WEIGHT_LIMIT;
	public static int RUN_SPD_BOOST;
	public static int DEATH_PENALTY_CHANCE;
	public static double RESPAWN_RESTORE_CP;
	public static double RESPAWN_RESTORE_HP;
	public static double RESPAWN_RESTORE_MP;
	public static boolean ALT_GAME_TIREDNESS;
	public static boolean AUTO_LOOT_HERBS;
	public static int PLAYER_FAKEDEATH_UP_PROTECTION;
	public static boolean ALT_GAME_SHIELD_BLOCKS;
	public static int ALT_PERFECT_SHLD_BLOCK;
	public static boolean ALT_GAME_SUBCLASS_WITHOUT_QUESTS;
	public static byte MAX_SUBCLASS;
	public static int MAX_PVTSTORESELL_SLOTS_DWARF;
	public static int MAX_PVTSTORESELL_SLOTS_OTHER;
	public static int MAX_PVTSTOREBUY_SLOTS_DWARF;
	public static int MAX_PVTSTOREBUY_SLOTS_OTHER;
	public static int INVENTORY_MAXIMUM_NO_DWARF;
	public static int INVENTORY_MAXIMUM_DWARF;
	public static int INVENTORY_MAXIMUM_GM;
	public static int WAREHOUSE_SLOTS_DWARF;
	public static int WAREHOUSE_SLOTS_NO_DWARF;
	public static int WAREHOUSE_SLOTS_CLAN;
	public static int FREIGHT_SLOTS;
	public static boolean ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE;
	public static boolean ALT_GAME_KARMA_PLAYER_CAN_SHOP;
	public static boolean ALT_GAME_KARMA_PLAYER_CAN_TELEPORT;
	public static boolean ALT_GAME_KARMA_PLAYER_CAN_USE_GK;
	public static boolean ALT_GAME_KARMA_PLAYER_CAN_TRADE;
	public static boolean ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE;
	public static int MAX_PERSONAL_FAME_POINTS;
	public static int FORTRESS_ZONE_FAME_TASK_FREQUENCY;
	public static int FORTRESS_ZONE_FAME_AQUIRE_POINTS;
	public static int CASTLE_ZONE_FAME_TASK_FREQUENCY;
	public static int CASTLE_ZONE_FAME_AQUIRE_POINTS;
	public static boolean IS_CRAFTING_ENABLED;
	public static int DWARF_RECIPE_LIMIT;
	public static int COMMON_RECIPE_LIMIT;
	public static boolean ENABLE_MASTERWORK;
	public static boolean ALT_GAME_CREATION;
	public static double ALT_GAME_CREATION_SPEED;
	public static double ALT_GAME_CREATION_XP_RATE;
	public static double ALT_GAME_CREATION_RARE_XPSP_RATE;
	public static double ALT_GAME_CREATION_SP_RATE;
	public static boolean ALT_BLACKSMITH_USE_RECIPES;
	public static int ALT_PARTY_RANGE;
	public static int ALT_PARTY_RANGE2;
	public static long STARTING_ADENA;
	public static boolean AUTO_LOOT;
	public static boolean AUTO_LOOT_RAIDS;
	public static int UNSTUCK_INTERVAL;
	public static int PLAYER_SPAWN_PROTECTION;
	public static boolean RESPAWN_RANDOM_ENABLED;
	public static int RESPAWN_RANDOM_MAX_OFFSET;
	public static boolean RESTORE_PLAYER_INSTANCE;
	public static boolean ALLOW_SUMMON_TO_INSTANCE;
	public static boolean PETITIONING_ALLOWED;
	public static int MAX_PETITIONS_PER_PLAYER;
	public static int MAX_PETITIONS_PENDING;
	public static boolean ALT_GAME_FREIGHTS;
	public static int ALT_GAME_FREIGHT_PRICE;
	public static boolean ALT_GAME_FREE_TELEPORT;
	public static boolean ALT_RECOMMEND;
	public static int DELETE_DAYS;
	public static float ALT_GAME_EXPONENT_XP;
	public static float ALT_GAME_EXPONENT_SP;
	public static String PARTY_XP_CUTOFF_METHOD;
	public static double PARTY_XP_CUTOFF_PERCENT;
	public static int PARTY_XP_CUTOFF_LEVEL;
	public static double HP_REGEN_MULTIPLIER;
	public static double MP_REGEN_MULTIPLIER;
	public static double CP_REGEN_MULTIPLIER;
 	public static int KAMA_TIME_COUNTER; 
 	public static boolean KAMA_COUNTER_TYPE; 
 	public static boolean KAMA_GM_COUNTER;
	
	//======================================================================================================= 
	public static final String ALT_FILE = "./config/main/alt_settings.properties"; 
	//======================================================================================================= 
	
	public static void loadAltConfig()
	{
		_log.info("Loading: " + ALT_FILE);
		InputStream is = null;

				// Load Alt Properties file (if exists)
				try
				{
					Properties altSettings = new Properties();
					is = new FileInputStream(new File(ALT_FILE));
					altSettings.load(is);

					ALT_GAME_DELEVEL = Boolean.parseBoolean(altSettings.getProperty("Delevel", "true"));
					ALT_WEIGHT_LIMIT = Double.parseDouble(altSettings.getProperty("AltWeightLimit", "1"));
					RUN_SPD_BOOST = Integer.parseInt(altSettings.getProperty("RunSpeedBoost", "0"));
					DEATH_PENALTY_CHANCE = Integer.parseInt(altSettings.getProperty("DeathPenaltyChance", "20"));
					RESPAWN_RESTORE_CP = Double.parseDouble(altSettings.getProperty("RespawnRestoreCP", "0")) / 100;
					RESPAWN_RESTORE_HP = Double.parseDouble(altSettings.getProperty("RespawnRestoreHP", "70")) / 100;
					RESPAWN_RESTORE_MP = Double.parseDouble(altSettings.getProperty("RespawnRestoreMP", "70")) / 100;
					HP_REGEN_MULTIPLIER = Double.parseDouble(altSettings.getProperty("HpRegenMultiplier", "100")) /100;
					MP_REGEN_MULTIPLIER = Double.parseDouble(altSettings.getProperty("MpRegenMultiplier", "100")) /100;
					CP_REGEN_MULTIPLIER = Double.parseDouble(altSettings.getProperty("CpRegenMultiplier", "100")) /100;
					ALT_GAME_TIREDNESS = Boolean.parseBoolean(altSettings.getProperty("AltGameTiredness", "false"));
					ALT_GAME_SHIELD_BLOCKS = Boolean.parseBoolean(altSettings.getProperty("AltShieldBlocks", "false"));
					ALT_PERFECT_SHLD_BLOCK = Integer.parseInt(altSettings.getProperty("AltPerfectShieldBlockRate", "10"));
					ALT_GAME_SUBCLASS_WITHOUT_QUESTS = Boolean.parseBoolean(altSettings.getProperty("AltSubClassWithoutQuests", "False"));
					MAX_SUBCLASS = Byte.parseByte(altSettings.getProperty("MaxSubclass", "3"));
					MAX_PVTSTORESELL_SLOTS_DWARF = Integer.parseInt(altSettings.getProperty("MaxPvtStoreSellSlotsDwarf", "4"));
					MAX_PVTSTORESELL_SLOTS_OTHER = Integer.parseInt(altSettings.getProperty("MaxPvtStoreSellSlotsOther", "3"));
					MAX_PVTSTOREBUY_SLOTS_DWARF = Integer.parseInt(altSettings.getProperty("MaxPvtStoreBuySlotsDwarf", "5"));
					MAX_PVTSTOREBUY_SLOTS_OTHER = Integer.parseInt(altSettings.getProperty("MaxPvtStoreBuySlotsOther", "4"));
					INVENTORY_MAXIMUM_NO_DWARF = Integer.parseInt(altSettings.getProperty("MaximumSlotsForNoDwarf", "80"));
					INVENTORY_MAXIMUM_DWARF = Integer.parseInt(altSettings.getProperty("MaximumSlotsForDwarf", "100"));
					INVENTORY_MAXIMUM_GM = Integer.parseInt(altSettings.getProperty("MaximumSlotsForGMPlayer", "250"));
					MAX_ITEM_IN_PACKET = Math.max(INVENTORY_MAXIMUM_NO_DWARF, Math.max(INVENTORY_MAXIMUM_DWARF, INVENTORY_MAXIMUM_GM));
					WAREHOUSE_SLOTS_DWARF = Integer.parseInt(altSettings.getProperty("MaximumWarehouseSlotsForDwarf", "120"));
					WAREHOUSE_SLOTS_NO_DWARF = Integer.parseInt(altSettings.getProperty("MaximumWarehouseSlotsForNoDwarf", "100"));
					WAREHOUSE_SLOTS_CLAN = Integer.parseInt(altSettings.getProperty("MaximumWarehouseSlotsForClan", "150"));
					FREIGHT_SLOTS = Integer.parseInt(altSettings.getProperty("MaximumFreightSlots", "20"));
					ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE = Boolean.parseBoolean(altSettings.getProperty("AltKarmaPlayerCanBeKilledInPeaceZone", "false"));
					ALT_GAME_KARMA_PLAYER_CAN_SHOP = Boolean.parseBoolean(altSettings.getProperty("AltKarmaPlayerCanShop", "true"));
					ALT_GAME_KARMA_PLAYER_CAN_TELEPORT = Boolean.parseBoolean(altSettings.getProperty("AltKarmaPlayerCanTeleport", "true"));
					ALT_GAME_KARMA_PLAYER_CAN_USE_GK = Boolean.parseBoolean(altSettings.getProperty("AltKarmaPlayerCanUseGK", "false"));
					ALT_GAME_KARMA_PLAYER_CAN_TRADE = Boolean.parseBoolean(altSettings.getProperty("AltKarmaPlayerCanTrade", "true"));
					ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE = Boolean.parseBoolean(altSettings.getProperty("AltKarmaPlayerCanUseWareHouse", "true"));
					MAX_PERSONAL_FAME_POINTS = Integer.parseInt(altSettings.getProperty("MaxPersonalFamePoints","65535"));
					FORTRESS_ZONE_FAME_TASK_FREQUENCY = Integer.parseInt(altSettings.getProperty("FortressZoneFameTaskFrequency","300"));
					FORTRESS_ZONE_FAME_AQUIRE_POINTS = Integer.parseInt(altSettings.getProperty("FortressZoneFameAquirePoints","31"));
					CASTLE_ZONE_FAME_TASK_FREQUENCY = Integer.parseInt(altSettings.getProperty("CastleZoneFameTaskFrequency","300"));
					CASTLE_ZONE_FAME_AQUIRE_POINTS = Integer.parseInt(altSettings.getProperty("CastleZoneFameAquirePoints","125"));
					IS_CRAFTING_ENABLED = Boolean.parseBoolean(altSettings.getProperty("CraftingEnabled", "true"));
					DWARF_RECIPE_LIMIT = Integer.parseInt(altSettings.getProperty("DwarfRecipeLimit","50"));
					COMMON_RECIPE_LIMIT = Integer.parseInt(altSettings.getProperty("CommonRecipeLimit","50"));
					ALT_GAME_CREATION = Boolean.parseBoolean(altSettings.getProperty("AltGameCreation", "false"));
					ENABLE_MASTERWORK = Boolean.parseBoolean(altSettings.getProperty("EnableMasterWork", "false"));
					ALT_GAME_CREATION_SPEED = Double.parseDouble(altSettings.getProperty("AltGameCreationSpeed", "1"));
					ALT_GAME_CREATION_XP_RATE = Double.parseDouble(altSettings.getProperty("AltGameCreationXpRate", "1"));
					ALT_GAME_CREATION_SP_RATE = Double.parseDouble(altSettings.getProperty("AltGameCreationSpRate", "1"));
					ALT_GAME_CREATION_RARE_XPSP_RATE = Double.parseDouble(altSettings.getProperty("AltGameCreationRareXpSpRate", "2"));
					ALT_BLACKSMITH_USE_RECIPES = Boolean.parseBoolean(altSettings.getProperty("AltBlacksmithUseRecipes", "true"));
					ALT_PARTY_RANGE = Integer.parseInt(altSettings.getProperty("AltPartyRange", "1600"));
					ALT_PARTY_RANGE2 = Integer.parseInt(altSettings.getProperty("AltPartyRange2", "1400"));
					STARTING_ADENA = Long.parseLong(altSettings.getProperty("StartingAdena", "0"));
					AUTO_LOOT = Boolean.parseBoolean(altSettings.getProperty("AutoLoot", "false"));
					AUTO_LOOT_RAIDS = Boolean.parseBoolean(altSettings.getProperty("AutoLootRaids", "false"));
					UNSTUCK_INTERVAL = Integer.parseInt(altSettings.getProperty("UnstuckInterval", "300"));
					PLAYER_SPAWN_PROTECTION = Integer.parseInt(altSettings.getProperty("PlayerSpawnProtection", "0"));
					RESPAWN_RANDOM_ENABLED = Boolean.parseBoolean(altSettings.getProperty("RespawnRandomInTown", "True"));
					RESPAWN_RANDOM_MAX_OFFSET = Integer.parseInt(altSettings.getProperty("RespawnRandomMaxOffset", "50"));
					RESTORE_PLAYER_INSTANCE = Boolean.parseBoolean(altSettings.getProperty("RestorePlayerInstance", "False"));
					ALLOW_SUMMON_TO_INSTANCE = Boolean.parseBoolean(altSettings.getProperty("AllowSummonToInstance", "True"));
					PETITIONING_ALLOWED = Boolean.parseBoolean(altSettings.getProperty("PetitioningAllowed", "True"));
					MAX_PETITIONS_PER_PLAYER = Integer.parseInt(altSettings.getProperty("MaxPetitionsPerPlayer", "5"));
					MAX_PETITIONS_PENDING = Integer.parseInt(altSettings.getProperty("MaxPetitionsPending", "25"));
					ALT_GAME_FREIGHTS = Boolean.parseBoolean(altSettings.getProperty("AltGameFreights", "true"));
					ALT_GAME_FREIGHT_PRICE = Integer.parseInt(altSettings.getProperty("AltGameFreightPrice", "1000"));
					ALT_GAME_FREE_TELEPORT = Boolean.parseBoolean(altSettings.getProperty("AltFreeTeleporting", "False"));
					ALT_RECOMMEND = Boolean.parseBoolean(altSettings.getProperty("AltRecommend", "False"));
					DELETE_DAYS = Integer.parseInt(altSettings.getProperty("DeleteCharAfterDays", "7"));
					ALT_GAME_EXPONENT_XP = Float.parseFloat(altSettings.getProperty("AltGameExponentXp", "0."));
					ALT_GAME_EXPONENT_SP = Float.parseFloat(altSettings.getProperty("AltGameExponentSp", "0."));
					PARTY_XP_CUTOFF_METHOD = altSettings.getProperty("PartyXpCutoffMethod", "auto");
					PARTY_XP_CUTOFF_PERCENT = Double.parseDouble(altSettings.getProperty("PartyXpCutoffPercent", "3."));
					PARTY_XP_CUTOFF_LEVEL = Integer.parseInt(altSettings.getProperty("PartyXpCutoffLevel", "30"));
					AUTO_LOOT_HERBS = Boolean.parseBoolean(altSettings.getProperty("AutoLootHerbs", "false"));
					PLAYER_FAKEDEATH_UP_PROTECTION = Integer.parseInt(altSettings.getProperty("PlayerFakeDeathUpProtection", "0"));
					KAMA_COUNTER_TYPE = Boolean.parseBoolean(altSettings.getProperty("KamaRetailTime", "True")); 
				 	KAMA_TIME_COUNTER = Integer.parseInt(altSettings.getProperty("KamaTimeCounter", "5")); 
				 	KAMA_GM_COUNTER = Boolean.parseBoolean(altSettings.getProperty("KamaGMSaveTime", "False"));
				}
			catch (Exception e)
			{
				e.printStackTrace();
				throw new Error("Failed to Load " + ALT_FILE + " file.");
			}
	}
	
	//-------------------------------------------------------------------------------------------------------
	// Options Settings
	//-------------------------------------------------------------------------------------------------------
	public static boolean EVERYBODY_HAS_ADMIN_RIGHTS;
	public static boolean DISPLAY_SERVER_VERSION;
	public static boolean SERVER_LIST_BRACKET;
	public static boolean SERVER_LIST_CLOCK;
	public static boolean SERVER_GMONLY;
	public static boolean BYPASS_VALIDATION;
	public static boolean GAMEGUARD_ENFORCE;
	public static boolean GAMEGUARD_PROHIBITACTION;
	public static boolean LOG_CHAT;
	public static boolean LOG_ITEMS;
	public static boolean GMAUDIT;
	public static boolean LOG_GAME_DAMAGE;
	public static boolean DEBUG;
	public static boolean PACKET_HANDLER_DEBUG;
	public static boolean ASSERT;
	public static boolean DEVELOPER;
	public static boolean ACCEPT_GEOEDITOR_CONN;
	public static boolean TEST_SERVER;
	public static boolean ALT_DEV_NO_QUESTS;
	public static boolean ALT_DEV_NO_SPAWNS;
	public static boolean SERVER_LIST_TESTSERVER;
	public static int THREAD_P_EFFECTS;
	public static int THREAD_P_GENERAL;
	public static int GENERAL_PACKET_THREAD_CORE_SIZE;
	public static int IO_PACKET_THREAD_CORE_SIZE;
	public static int GENERAL_THREAD_CORE_SIZE;
	public static int AI_MAX_THREAD;
	public static int PACKET_LIFETIME;
	public static boolean DEADLOCK_DETECTOR;
	public static int DEADLOCK_CHECK_INTERVAL;
	public static boolean RESTART_ON_DEADLOCK;
	public static boolean ALLOW_DISCARDITEM;
	public static int AUTODESTROY_ITEM_AFTER;
	public static int HERB_AUTO_DESTROY_TIME;
	public static String PROTECTED_ITEMS;
	public static List<Integer> LIST_PROTECTED_ITEMS = new FastList<Integer>();
	public static int CHAR_STORE_INTERVAL;
	public static boolean LAZY_ITEMS_UPDATE;
	public static boolean UPDATE_ITEMS_ON_CHAR_STORE;
	public static boolean DESTROY_DROPPED_PLAYER_ITEM;
	public static boolean DESTROY_EQUIPABLE_PLAYER_ITEM;
	public static boolean SAVE_DROPPED_ITEM;
	public static boolean EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD;
	public static int SAVE_DROPPED_ITEM_INTERVAL;
	public static boolean CLEAR_DROPPED_ITEM_TABLE;
	public static boolean AUTODELETE_INVALID_QUEST_DATA;
	public static boolean PRECISE_DROP_CALCULATION;
	public static boolean MULTIPLE_ITEM_DROP;
	public static boolean FORCE_INVENTORY_UPDATE;
	public static boolean LAZY_CACHE;
	public static int MIN_NPC_ANIMATION;
	public static int MAX_NPC_ANIMATION;
	public static int MIN_MONSTER_ANIMATION;
	public static int MAX_MONSTER_ANIMATION;
	public static int COORD_SYNCHRONIZE;
	public static boolean GRIDS_ALWAYS_ON;
	public static int GRID_NEIGHBOR_TURNON_TIME;
	public static int GRID_NEIGHBOR_TURNOFF_TIME;
	public static boolean MOVE_BASED_KNOWNLIST;
	public static long KNOWNLIST_UPDATE_INTERVAL;
	public static int ZONE_TOWN;
	public static boolean ACTIVATE_POSITION_RECORDER;
	public static String DEFAULT_GLOBAL_CHAT;
	public static String DEFAULT_TRADE_CHAT;
	public static boolean ALLOW_WAREHOUSE;
	public static boolean WAREHOUSE_CACHE;
	public static int WAREHOUSE_CACHE_TIME;
	public static boolean ALLOW_FREIGHT;
	public static boolean ALLOW_WEAR;
	public static int WEAR_DELAY;
	public static int WEAR_PRICE;
	public static boolean ALLOW_RACE;
	public static boolean ALLOW_WATER;
	public static boolean ALLOW_RENTPET;
	public static boolean ALLOWFISHING;
	public static boolean ALLOW_BOAT;
	public static boolean ALLOW_CURSED_WEAPONS;
	public static boolean ALLOW_NPC_WALKERS;
	public static boolean ALLOW_PET_WALKERS;
	public static boolean SERVER_NEWS;
	public static int COMMUNITY_TYPE;
	public static boolean BBS_SHOW_PLAYERLIST;
	public static String BBS_DEFAULT;
	public static boolean SHOW_LEVEL_COMMUNITYBOARD;
	public static boolean SHOW_STATUS_COMMUNITYBOARD;
	public static int NAME_PAGE_SIZE_COMMUNITYBOARD;
	public static int NAME_PER_ROW_COMMUNITYBOARD;
	public static int FS_TIME_ATTACK;
	public static int FS_TIME_COOLDOWN;
	public static int FS_TIME_ENTRY;
	public static int FS_TIME_WARMUP;
	public static int FS_PARTY_MEMBER_COUNT;
	public static int RIFT_MIN_PARTY_SIZE;
	public static int RIFT_SPAWN_DELAY;
	public static int RIFT_MAX_JUMPS;
	public static int RIFT_AUTO_JUMPS_TIME_MIN;
	public static int RIFT_AUTO_JUMPS_TIME_MAX;
	public static float RIFT_BOSS_ROOM_TIME_MUTIPLY;
	public static int RIFT_ENTER_COST_RECRUIT;
	public static int RIFT_ENTER_COST_SOLDIER;
	public static int RIFT_ENTER_COST_OFFICER;
	public static int RIFT_ENTER_COST_CAPTAIN;
	public static int RIFT_ENTER_COST_COMMANDER;
	public static int RIFT_ENTER_COST_HERO;
	public static int DEFAULT_PUNISH;
	public static int DEFAULT_PUNISH_PARAM;
	public static boolean ONLY_GM_ITEMS_FREE;
	public static boolean JAIL_DISABLE_CHAT;
	
	public static boolean ALLOW_KEYBOARD_MOVEMENT;
	public static String HTM_ENCODING;
	public static boolean BAN_CLIENT_EMULATORS;
	
    //======================================================================================================= 
	public static final String OPTIONS_FILE = "./config/main/options.properties";
    //======================================================================================================= 
	
	public static void loadOptionsConfig()
	{
		_log.info("Loading: " + OPTIONS_FILE);
		InputStream is = null;

				// Load Options Properties file (if exists)
				try
				{
					Properties optionsSettings = new Properties();
					is = new FileInputStream(new File(OPTIONS_FILE));
					optionsSettings.load(is);

					EVERYBODY_HAS_ADMIN_RIGHTS = Boolean.parseBoolean(optionsSettings.getProperty("EverybodyHasAdminRights", "false"));
					DISPLAY_SERVER_VERSION = Boolean.parseBoolean(optionsSettings.getProperty("DisplayServerRevision","True"));
					SERVER_LIST_BRACKET = Boolean.parseBoolean(optionsSettings.getProperty("ServerListBrackets", "false"));
					SERVER_LIST_CLOCK = Boolean.parseBoolean(optionsSettings.getProperty("ServerListClock", "false"));
					SERVER_GMONLY = Boolean.parseBoolean(optionsSettings.getProperty("ServerGMOnly", "false"));
					BYPASS_VALIDATION = Boolean.parseBoolean(optionsSettings.getProperty("BypassValidation", "True"));
					GAMEGUARD_ENFORCE = Boolean.parseBoolean(optionsSettings.getProperty("GameGuardEnforce", "True"));
					GAMEGUARD_PROHIBITACTION = Boolean.parseBoolean(optionsSettings.getProperty("GameGuardProhibitAction", "True"));
					LOG_CHAT = Boolean.parseBoolean(optionsSettings.getProperty("LogChat", "false"));
					LOG_ITEMS = Boolean.parseBoolean(optionsSettings.getProperty("LogItems", "false"));
					GMAUDIT = Boolean.parseBoolean(optionsSettings.getProperty("GMAudit", "False"));
					LOG_GAME_DAMAGE = Boolean.parseBoolean(optionsSettings.getProperty("LogGameDamage", "False"));
					DEBUG = Boolean.parseBoolean(optionsSettings.getProperty("Debug", "false"));
					PACKET_HANDLER_DEBUG = Boolean.parseBoolean(optionsSettings.getProperty("PacketHandlerDebug", "false"));
					ASSERT = Boolean.parseBoolean(optionsSettings.getProperty("Assert", "false"));
					DEVELOPER = Boolean.parseBoolean(optionsSettings.getProperty("Developer", "false"));
					ACCEPT_GEOEDITOR_CONN = Boolean.parseBoolean(optionsSettings.getProperty("AcceptGeoeditorConn", "false"));
					TEST_SERVER = Boolean.parseBoolean(optionsSettings.getProperty("TestServer", "false"));
					SERVER_LIST_TESTSERVER = Boolean.parseBoolean(optionsSettings.getProperty("ListTestServers", "false"));
					ALT_DEV_NO_QUESTS = Boolean.parseBoolean(optionsSettings.getProperty("AltDevNoQuests", "False"));
					ALT_DEV_NO_SPAWNS = Boolean.parseBoolean(optionsSettings.getProperty("AltDevNoSpawns", "False"));
					THREAD_P_EFFECTS = Integer.parseInt(optionsSettings.getProperty("ThreadPoolSizeEffects", "10"));
					THREAD_P_GENERAL = Integer.parseInt(optionsSettings.getProperty("ThreadPoolSizeGeneral", "13"));
					IO_PACKET_THREAD_CORE_SIZE = Integer.parseInt(optionsSettings.getProperty("UrgentPacketThreadCoreSize", "2"));
					GENERAL_PACKET_THREAD_CORE_SIZE = Integer.parseInt(optionsSettings.getProperty("GeneralPacketThreadCoreSize", "4"));
					GENERAL_THREAD_CORE_SIZE = Integer.parseInt(optionsSettings.getProperty("GeneralThreadCoreSize", "4"));
					AI_MAX_THREAD = Integer.parseInt(optionsSettings.getProperty("AiMaxThread", "6"));
					PACKET_LIFETIME = Integer.parseInt(optionsSettings.getProperty("PacketLifeTime", "0"));
					DEADLOCK_DETECTOR = Boolean.parseBoolean(optionsSettings.getProperty("DeadLockDetector", "False"));
					DEADLOCK_CHECK_INTERVAL = Integer.parseInt(optionsSettings.getProperty("DeadLockCheckInterval", "20"));
					RESTART_ON_DEADLOCK = Boolean.parseBoolean(optionsSettings.getProperty("RestartOnDeadlock", "False"));
					ALLOW_DISCARDITEM = Boolean.parseBoolean(optionsSettings.getProperty("AllowDiscardItem", "True"));
					AUTODESTROY_ITEM_AFTER = Integer.parseInt(optionsSettings.getProperty("AutoDestroyDroppedItemAfter", "600"));
					HERB_AUTO_DESTROY_TIME = Integer.parseInt(optionsSettings.getProperty("AutoDestroyHerbTime","15"))*1000;
					PROTECTED_ITEMS = optionsSettings.getProperty("ListOfProtectedItems", "0");
					LIST_PROTECTED_ITEMS = new FastList<Integer>();
					for (String id : PROTECTED_ITEMS.split(","))
					{
						LIST_PROTECTED_ITEMS.add(Integer.parseInt(id));
					}
					CHAR_STORE_INTERVAL = Integer.parseInt(optionsSettings.getProperty("CharacterDataStoreInterval", "15"));
					LAZY_ITEMS_UPDATE = Boolean.parseBoolean(optionsSettings.getProperty("LazyItemsUpdate", "false"));
					UPDATE_ITEMS_ON_CHAR_STORE = Boolean.parseBoolean(optionsSettings.getProperty("UpdateItemsOnCharStore", "false"));
					DESTROY_DROPPED_PLAYER_ITEM = Boolean.parseBoolean(optionsSettings.getProperty("DestroyPlayerDroppedItem", "false"));
					DESTROY_EQUIPABLE_PLAYER_ITEM = Boolean.parseBoolean(optionsSettings.getProperty("DestroyEquipableItem", "false"));
					SAVE_DROPPED_ITEM = Boolean.parseBoolean(optionsSettings.getProperty("SaveDroppedItem", "false"));
					EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD = Boolean.parseBoolean(optionsSettings.getProperty("EmptyDroppedItemTableAfterLoad", "false"));
					SAVE_DROPPED_ITEM_INTERVAL = Integer.parseInt(optionsSettings.getProperty("SaveDroppedItemInterval", "60"))*60000;
					CLEAR_DROPPED_ITEM_TABLE = Boolean.parseBoolean(optionsSettings.getProperty("ClearDroppedItemTable", "false"));
					AUTODELETE_INVALID_QUEST_DATA = Boolean.parseBoolean(optionsSettings.getProperty("AutoDeleteInvalidQuestData", "False"));
					PRECISE_DROP_CALCULATION = Boolean.parseBoolean(optionsSettings.getProperty("PreciseDropCalculation", "True"));
					MULTIPLE_ITEM_DROP = Boolean.parseBoolean(optionsSettings.getProperty("MultipleItemDrop", "True"));
					FORCE_INVENTORY_UPDATE = Boolean.parseBoolean(optionsSettings.getProperty("ForceInventoryUpdate", "False"));
					LAZY_CACHE = Boolean.parseBoolean(optionsSettings.getProperty("LazyCache", "True"));
					MIN_NPC_ANIMATION = Integer.parseInt(optionsSettings.getProperty("MinNPCAnimation", "10"));
					MAX_NPC_ANIMATION = Integer.parseInt(optionsSettings.getProperty("MaxNPCAnimation", "20"));
					MIN_MONSTER_ANIMATION = Integer.parseInt(optionsSettings.getProperty("MinMonsterAnimation", "5"));
					MAX_MONSTER_ANIMATION = Integer.parseInt(optionsSettings.getProperty("MaxMonsterAnimation", "20"));
					MOVE_BASED_KNOWNLIST = Boolean.parseBoolean(optionsSettings.getProperty("MoveBasedKnownlist", "False"));
					KNOWNLIST_UPDATE_INTERVAL = Long.parseLong(optionsSettings.getProperty("KnownListUpdateInterval", "1250"));
					GRIDS_ALWAYS_ON = Boolean.parseBoolean(optionsSettings.getProperty("GridsAlwaysOn", "False"));
					GRID_NEIGHBOR_TURNON_TIME = Integer.parseInt(optionsSettings.getProperty("GridNeighborTurnOnTime", "1"));
					GRID_NEIGHBOR_TURNOFF_TIME = Integer.parseInt(optionsSettings.getProperty("GridNeighborTurnOffTime", "90"));
					COORD_SYNCHRONIZE = Integer.parseInt(optionsSettings.getProperty("CoordSynchronize", "-1"));
					ZONE_TOWN = Integer.parseInt(optionsSettings.getProperty("ZoneTown", "0"));
					ACTIVATE_POSITION_RECORDER = Boolean.parseBoolean(optionsSettings.getProperty("ActivatePositionRecorder", "False"));
					DEFAULT_GLOBAL_CHAT = optionsSettings.getProperty("GlobalChat", "ON");
					DEFAULT_TRADE_CHAT = optionsSettings.getProperty("TradeChat", "LIMITED");
					ALLOW_WAREHOUSE = Boolean.parseBoolean(optionsSettings.getProperty("AllowWarehouse", "True"));
					WAREHOUSE_CACHE = Boolean.parseBoolean(optionsSettings.getProperty("WarehouseCache", "False"));
					WAREHOUSE_CACHE_TIME = Integer.parseInt(optionsSettings.getProperty("WarehouseCacheTime", "15"));
					ALLOW_FREIGHT = Boolean.parseBoolean(optionsSettings.getProperty("AllowFreight", "True"));
					ALLOW_WEAR = Boolean.parseBoolean(optionsSettings.getProperty("AllowWear", "False"));
					WEAR_DELAY = Integer.parseInt(optionsSettings.getProperty("WearDelay", "5"));
					WEAR_PRICE = Integer.parseInt(optionsSettings.getProperty("WearPrice", "10"));
					ALLOW_RACE = Boolean.parseBoolean(optionsSettings.getProperty("AllowRace", "True"));
					ALLOW_WATER = Boolean.parseBoolean(optionsSettings.getProperty("AllowWater", "True"));
					ALLOW_RENTPET = Boolean.parseBoolean(optionsSettings.getProperty("AllowRentPet", "False"));
					ALLOW_DISCARDITEM = Boolean.parseBoolean(optionsSettings.getProperty("AllowDiscardItem", "True"));
					ALLOWFISHING = Boolean.parseBoolean(optionsSettings.getProperty("AllowFishing", "True"));
					ALLOW_BOAT = Boolean.parseBoolean(optionsSettings.getProperty("AllowBoat", "True"));
					ALLOW_CURSED_WEAPONS = Boolean.parseBoolean(optionsSettings.getProperty("AllowCursedWeapons", "True"));
					ALLOW_NPC_WALKERS = Boolean.parseBoolean(optionsSettings.getProperty("AllowNpcWalkers", "true"));
					ALLOW_PET_WALKERS = Boolean.parseBoolean(optionsSettings.getProperty("AllowPetWalkers", "True"));
					SERVER_NEWS = Boolean.parseBoolean(optionsSettings.getProperty("ShowServerNews", "False"));
					COMMUNITY_TYPE = Integer.parseInt(optionsSettings.getProperty("CommunityType", "1"));
					BBS_SHOW_PLAYERLIST = Boolean.parseBoolean(optionsSettings.getProperty("BBSShowPlayerList", "false"));
					BBS_DEFAULT = optionsSettings.getProperty("BBSDefault", "_bbshome");
					SHOW_LEVEL_COMMUNITYBOARD = Boolean.parseBoolean(optionsSettings.getProperty("ShowLevelOnCommunityBoard", "False"));
					SHOW_STATUS_COMMUNITYBOARD = Boolean.parseBoolean(optionsSettings.getProperty("ShowStatusOnCommunityBoard", "True"));
					NAME_PAGE_SIZE_COMMUNITYBOARD = Integer.parseInt(optionsSettings.getProperty("NamePageSizeOnCommunityBoard", "50"));
					NAME_PER_ROW_COMMUNITYBOARD = Integer.parseInt(optionsSettings.getProperty("NamePerRowOnCommunityBoard", "5"));
					FS_TIME_ATTACK = Integer.parseInt(optionsSettings.getProperty("TimeOfAttack", "50"));
					FS_TIME_COOLDOWN = Integer.parseInt(optionsSettings.getProperty("TimeOfCoolDown", "5"));
					FS_TIME_ENTRY = Integer.parseInt(optionsSettings.getProperty("TimeOfEntry", "3"));
					FS_TIME_WARMUP = Integer.parseInt(optionsSettings.getProperty("TimeOfWarmUp", "2"));
					FS_PARTY_MEMBER_COUNT = Integer.parseInt(optionsSettings.getProperty("NumberOfNecessaryPartyMembers", "4"));
					if (FS_TIME_ATTACK <= 0)
						FS_TIME_ATTACK = 50;
					if (FS_TIME_COOLDOWN <= 0)
						FS_TIME_COOLDOWN = 5;
					if (FS_TIME_ENTRY <= 0)
						FS_TIME_ENTRY = 3;
					if (FS_TIME_ENTRY <= 0)
						FS_TIME_ENTRY = 3;
					if (FS_TIME_ENTRY <= 0)
						FS_TIME_ENTRY = 3;
					RIFT_MIN_PARTY_SIZE = Integer.parseInt(optionsSettings.getProperty("RiftMinPartySize", "5"));
					RIFT_MAX_JUMPS = Integer.parseInt(optionsSettings.getProperty("MaxRiftJumps", "4"));
					RIFT_SPAWN_DELAY = Integer.parseInt(optionsSettings.getProperty("RiftSpawnDelay", "10000"));
					RIFT_AUTO_JUMPS_TIME_MIN = Integer.parseInt(optionsSettings.getProperty("AutoJumpsDelayMin", "480"));
					RIFT_AUTO_JUMPS_TIME_MAX = Integer.parseInt(optionsSettings.getProperty("AutoJumpsDelayMax", "600"));
					RIFT_BOSS_ROOM_TIME_MUTIPLY = Float.parseFloat(optionsSettings.getProperty("BossRoomTimeMultiply", "1.5"));
					RIFT_ENTER_COST_RECRUIT = Integer.parseInt(optionsSettings.getProperty("RecruitCost", "18"));
					RIFT_ENTER_COST_SOLDIER = Integer.parseInt(optionsSettings.getProperty("SoldierCost", "21"));
					RIFT_ENTER_COST_OFFICER = Integer.parseInt(optionsSettings.getProperty("OfficerCost", "24"));
					RIFT_ENTER_COST_CAPTAIN = Integer.parseInt(optionsSettings.getProperty("CaptainCost", "27"));
					RIFT_ENTER_COST_COMMANDER = Integer.parseInt(optionsSettings.getProperty("CommanderCost", "30"));
					RIFT_ENTER_COST_HERO = Integer.parseInt(optionsSettings.getProperty("HeroCost", "33"));
					DEFAULT_PUNISH = Integer.parseInt(optionsSettings.getProperty("DefaultPunish", "2"));
					DEFAULT_PUNISH_PARAM = Integer.parseInt(optionsSettings.getProperty("DefaultPunishParam", "0"));
					ONLY_GM_ITEMS_FREE = Boolean.parseBoolean(optionsSettings.getProperty("OnlyGMItemsFree", "True"));
					JAIL_DISABLE_CHAT = Boolean.parseBoolean(optionsSettings.getProperty("JailDisableChat", "True"));
					ALLOW_KEYBOARD_MOVEMENT = Boolean.valueOf(optionsSettings.getProperty("AllowKeyboardMovement", "False"));
					HTM_ENCODING = optionsSettings.getProperty("HtmEncoding", "UTF-8");
				 	BAN_CLIENT_EMULATORS = Boolean.parseBoolean(optionsSettings.getProperty("AutoBanClientEmulators", "false"));
				}
			catch (Exception e)
			{
				e.printStackTrace();
				throw new Error("Failed to Load " + OPTIONS_FILE + " File.");
			}	
	}
	
	//-------------------------------------------------------------------------------------------------------
	// Custom Settings
	//-------------------------------------------------------------------------------------------------------
	
	public static boolean CUSTOM_SPAWNLIST_TABLE;
	public static boolean SAVE_GMSPAWN_ON_CUSTOM;
	public static boolean DELETE_GMSPAWN_ON_CUSTOM;
	public static boolean CUSTOM_NPC_TABLE;
	public static boolean CUSTOM_ITEM_TABLES;
	public static boolean CUSTOM_ARMORSETS_TABLE;
	public static boolean CUSTOM_TELEPORT_TABLE;
	public static boolean CUSTOM_DROPLIST_TABLE;
	public static boolean CUSTOM_MERCHANT_TABLES;
	
	//--------------------------------------------------
	// L2JMods Settings
	//--------------------------------------------------
	public static boolean BANKING_SYSTEM_ENABLED;
	public static int BANKING_SYSTEM_GOLDBAR_ID;
	public static int BANKING_SYSTEM_GOLDBARS;
	public static int BANKING_SYSTEM_ADENA;
	public static boolean L2JMOD_ENABLE_WAREHOUSESORTING_CLAN;
	public static boolean L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE;
	public static boolean L2JMOD_ENABLE_WAREHOUSESORTING_FREIGHT;
	
	//--------------------------------------------------
	// L2Emu Settings
	//--------------------------------------------------
	public static String SERVER_NAME;
	
	public static boolean ALLOW_NEW_CHARACTER_TITLE;
	public static String NEW_CHARACTER_TITLE;
	
	public static boolean ALLOW_SERVER_WELCOME_MESSAGE;
	public static String SERVER_WELCOME_MESSAGE;
	
	public static boolean ALLOW_PVP_REWARD;
	public static int PVP_REWARD_ITEM_ID;
	public static String PVP_REWARD_ITEM_NAME;
	public static int PVP_REWARD_ITEM_AMMOUNT;
	
	public static boolean ALLOW_CUSTOM_STARTER_ITEMS;
	public static List<int[]> CUSTOM_STARTER_ITEMS = new FastList<int[]>();

	public static int GM_MAX_ENCHANT;
	public static boolean ACUMULATIVE_SUBCLASS_SKILLS;
	
	public static int DONATOR_NAME_COLOR;
	public static int DONATOR_TITLE_COLOR;
	public static String DONATOR_WELCOME_MESSAGE;
	
	public static boolean CLAN_LEADER_COLOR_ENABLED;
	public static int CLAN_LEADER_COLOR_CLAN_LEVEL;
	public static int CLAN_LEADER_NAME_COLOR;
	public static int CLAN_LEADER_TITLE_COLOR;
	public static boolean ANNOUNCE_CASTLE_LORDS;
	
	public static int DEFAULT_NAME_COLOR;
	public static int DEFAULT_TITLE_COLOR;
	
	public static boolean ALT_ANNOUNCE_PK;
	public static boolean ALLOW_GRADE_PENALTY;
	
	public static boolean ONLINE_PLAYERS_AT_STARTUP;
	public static int ONLINE_PLAYERS_ANNOUNCE_INTERVAL;
	
	public static boolean ALLOW_SCREEN_WELCOME_MESSAGE;
	public static String SCREEN_WELCOME_MESSAGE;
	public static int SCREEN_WELCOME_MESSAGE_TIME;
	
	public static boolean ALLOW_VOTE_REWARD;
	public static int VOTE_REWARD_ITEM_ID;
	public static String VOTE_REWARD_ITEM_NAME;
	
	public static boolean ALLOW_EVENT_VOTE;
	
	//=======================================================================================================
	public static final String CUSTOM_CONFIG_FILE = "./config/main/custom.properties";
	//=======================================================================================================

	
	public static void loadCustomConfig()
	{
		_log.info("Loading: " + CUSTOM_CONFIG_FILE);
		InputStream is = null;

				// Load  Properties file (if exists)
				try
				{
					Properties customSettings = new Properties();
					is = new FileInputStream(new File(CUSTOM_CONFIG_FILE));
					customSettings.load(is);

					CUSTOM_SPAWNLIST_TABLE = Boolean.valueOf(customSettings.getProperty("CustomSpawnlistTable", "false"));
					SAVE_GMSPAWN_ON_CUSTOM = Boolean.valueOf(customSettings.getProperty("SaveGmSpawnOnCustom", "false"));
					DELETE_GMSPAWN_ON_CUSTOM = Boolean.valueOf(customSettings.getProperty("DeleteGmSpawnOnCustom", "false"));
					CUSTOM_NPC_TABLE = Boolean.valueOf(customSettings.getProperty("CustomNpcTable", "false"));
					CUSTOM_ITEM_TABLES = Boolean.valueOf(customSettings.getProperty("CustomItemTables", "false"));
					CUSTOM_ARMORSETS_TABLE = Boolean.valueOf(customSettings.getProperty("CustomArmorSetsTable", "false"));
					CUSTOM_TELEPORT_TABLE = Boolean.valueOf(customSettings.getProperty("CustomTeleportTable", "false"));
					CUSTOM_DROPLIST_TABLE = Boolean.valueOf(customSettings.getProperty("CustomDroplistTable", "false"));
					CUSTOM_MERCHANT_TABLES = Boolean.valueOf(customSettings.getProperty("CustomMerchantTables", "false"));
					
					BANKING_SYSTEM_ENABLED = Boolean.parseBoolean(customSettings.getProperty("BankingEnabled", "false"));
					BANKING_SYSTEM_GOLDBAR_ID = Integer.parseInt(customSettings.getProperty("BankingGoldbarId", "3470"));
					BANKING_SYSTEM_GOLDBARS = Integer.parseInt(customSettings.getProperty("BankingGoldbarCount", "1"));
					BANKING_SYSTEM_ADENA = Integer.parseInt(customSettings.getProperty("BankingAdenaCount", "500000000"));

					L2JMOD_ENABLE_WAREHOUSESORTING_CLAN = Boolean.valueOf(customSettings.getProperty("EnableWarehouseSortingClan", "False"));
					L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE = Boolean.valueOf(customSettings.getProperty("EnableWarehouseSortingPrivate", "False"));
					L2JMOD_ENABLE_WAREHOUSESORTING_FREIGHT = Boolean.valueOf(customSettings.getProperty("EnableWarehouseSortingFreight", "False"));
									
					ACUMULATIVE_SUBCLASS_SKILLS = Boolean.parseBoolean(customSettings.getProperty("AltSubclassSkills", "false"));
				
					GM_MAX_ENCHANT = Integer.parseInt(customSettings.getProperty("GMMaxEnchant", "65535"));
					
					ALT_ANNOUNCE_PK = Boolean.parseBoolean(customSettings.getProperty("AltAnnouncePk", "false"));
					
					ALLOW_GRADE_PENALTY = Boolean.parseBoolean(customSettings.getProperty("AllowGradePenalty", "true"));
					
					SERVER_NAME = customSettings.getProperty("ServerName", "L2EmuProject");
					
					ALLOW_NEW_CHARACTER_TITLE = Boolean.parseBoolean(customSettings.getProperty("AllowNewCharacterTitle", "false")); 
				 	NEW_CHARACTER_TITLE = customSettings.getProperty("NewCharacterTitle", "Newbie");
				 	
				 	ALLOW_SERVER_WELCOME_MESSAGE = Boolean.parseBoolean(customSettings.getProperty("AllowServerWelcomeMessage", "false")); 
				 	SERVER_WELCOME_MESSAGE = customSettings.getProperty("ServerWelcomeMessage", "Welcome to my Server!");
				 	
				 	ALLOW_PVP_REWARD = Boolean.parseBoolean(customSettings.getProperty("AllowPvpReward", "false"));
				 	PVP_REWARD_ITEM_ID = Integer.parseInt(customSettings.getProperty("PvpRewardItemId", "57"));
				 	PVP_REWARD_ITEM_NAME = customSettings.getProperty("PvpRewardItemName", "Adena");
				 	PVP_REWARD_ITEM_AMMOUNT = Integer.parseInt(customSettings.getProperty("PvpRewardAmmount", "100"));
				 	
				 	DEFAULT_NAME_COLOR = Integer.decode("0x" + customSettings.getProperty("DefaultNameColor", "FFFFFF"));
				 	DEFAULT_TITLE_COLOR = Integer.decode("0x" + customSettings.getProperty("DefaultTitleColor", "FFFF77"));
				 	
				 	DONATOR_NAME_COLOR = Integer.decode("0x" + customSettings.getProperty("DonatorNameColor", "00CCFF"));
				 	DONATOR_TITLE_COLOR = Integer.decode("0x" + customSettings.getProperty("DonatorTitleColor", "00CCFF"));
				 	DONATOR_WELCOME_MESSAGE = customSettings.getProperty("DonatorWelcomeMessage", "Welcome back to our server! Enjoy your stay!");
				 	
				 	CLAN_LEADER_COLOR_ENABLED = Boolean.parseBoolean(customSettings.getProperty("ClanLeaderColorEnabled", "false")); 
				 	CLAN_LEADER_COLOR_CLAN_LEVEL = Integer.parseInt(customSettings.getProperty("ClanLeaderColorClanLevel", "0"));
				 	CLAN_LEADER_NAME_COLOR = Integer.decode("0x" + customSettings.getProperty("ClanLeaderNameColor", "00FF00"));
				 	CLAN_LEADER_TITLE_COLOR = Integer.decode("0x" + customSettings.getProperty("ClanLeaderTitleColor", "FFFF77"));
				 	ANNOUNCE_CASTLE_LORDS = Boolean.parseBoolean(customSettings.getProperty("AnnounceCastleLords", "false")); 

				 	ALLOW_SCREEN_WELCOME_MESSAGE = Boolean.parseBoolean(customSettings.getProperty("AllowScreenWelcomeMessage", "false"));
				 	SCREEN_WELCOME_MESSAGE = customSettings.getProperty("ScreenWelcomeMessage", "Welcome to my Server!");
				 	SCREEN_WELCOME_MESSAGE_TIME = Integer.parseInt(customSettings.getProperty("ScreenWelcomeMessageTime", "5000"));
				 	
				 	ONLINE_PLAYERS_AT_STARTUP = Boolean.parseBoolean(customSettings.getProperty("OnlinePlayersAtStartup", "false")); 
				 	ONLINE_PLAYERS_ANNOUNCE_INTERVAL = Integer.parseInt(customSettings.getProperty("OnlinePlayersAnnounceInterval", "900000"));
				 	
				 	ALLOW_VOTE_REWARD = Boolean.parseBoolean(customSettings.getProperty("AllowVoteReward", "false"));
				 	VOTE_REWARD_ITEM_ID = Integer.parseInt(customSettings.getProperty("VoteRewardItemId", "6392"));
				 	VOTE_REWARD_ITEM_NAME = customSettings.getProperty("VoteRewardItemName", "Event - Medal");

				 	ALLOW_EVENT_VOTE = Boolean.parseBoolean(customSettings.getProperty("AllowEventVote", "false"));
				 	
				 	ALLOW_CUSTOM_STARTER_ITEMS = Boolean.parseBoolean(customSettings.getProperty("AllowCustomStarterItems", "false"));
				 	
					if (ALLOW_CUSTOM_STARTER_ITEMS)
					{
					    String[] propertySplit = customSettings.getProperty("CustomStarterItems", "0,0").split(";");
					    for (String starteritems : propertySplit)
					    {
					    	String[] starteritemsSplit = starteritems.split(",");
					    	if (starteritemsSplit.length != 2)
					    	{
					    		ALLOW_CUSTOM_STARTER_ITEMS = false;
					    		System.out.println("StarterItems[Config.load()]: invalid config property -> starter items \""+ starteritems + "\"");
					    	} 
					    	else
					    	{
					    	try
						    {
								CUSTOM_STARTER_ITEMS.add(new int[] { Integer.valueOf(starteritemsSplit[0]), Integer.valueOf(starteritemsSplit[1]) });
						    } 
						    	catch (NumberFormatException nfe)
						    	{
						    		if (!starteritems.equals(""))
						    		{
						    			ALLOW_CUSTOM_STARTER_ITEMS = false;
						    			System.out.println("StarterItems[Config.load()]: invalid config property -> starter items \"" + starteritems + "\"");
						    		}
						    	}
					    	}
					    }
					}
				}
			catch (Exception e)
			{
				e.printStackTrace();
				throw new Error("Failed to Load " + CUSTOM_CONFIG_FILE + " File.");
			}	
	}
	
	//-------------------------------------------------------------------------------------------------------
	// Vitality Settings
	//-------------------------------------------------------------------------------------------------------
	public static boolean ENABLE_VITALITY;
	public static boolean RECOVER_VITALITY_ON_RECONNECT;
	public static boolean ENABLE_VITALITY_CHAMPION;
	public static boolean ENABLE_DROP_VITALITY_HERBS;
	public static float	RATE_VITALITY_LEVEL_1;
	public static float	RATE_VITALITY_LEVEL_2;
	public static float	RATE_VITALITY_LEVEL_3;
	public static float	RATE_VITALITY_LEVEL_4;
	public static float	RATE_DROP_VITALITY_HERBS;
	public static float	RATE_RECOVERY_VITALITY_PEACE_ZONE;
	public static float	RATE_VITALITY_LOST;
	public static float	RATE_VITALITY_GAIN;
	public static float	RATE_RECOVERY_ON_RECONNECT;
	
	//======================================================================================================= 
	public static final String VITALITY_FILE = "./config/main/vitality.properties"; 
	//=======================================================================================================
	
	public static void loadVitalityConfig()
	{
		_log.info("Loading: " + VITALITY_FILE);
		InputStream is = null;

				// Load Vitality Properties file (if exists)
				try
				{
					Properties vitalitySettings = new Properties();
					is = new FileInputStream(new File(VITALITY_FILE));
					vitalitySettings.load(is);
					
					ENABLE_VITALITY = Boolean.parseBoolean(vitalitySettings.getProperty("EnableVitality", "True"));
					RECOVER_VITALITY_ON_RECONNECT = Boolean.parseBoolean(vitalitySettings.getProperty("RecoverVitalityOnReconnect", "True"));
					ENABLE_VITALITY_CHAMPION = Boolean.parseBoolean(vitalitySettings.getProperty("EnableVitalityOnChampion", "False"));
					ENABLE_DROP_VITALITY_HERBS = Boolean.parseBoolean(vitalitySettings.getProperty("EnableVitalityHerbs", "True"));
					RATE_VITALITY_LEVEL_1 = Float.parseFloat(vitalitySettings.getProperty("RateVitalityLevel1", "1.5"));
					RATE_VITALITY_LEVEL_2 = Float.parseFloat(vitalitySettings.getProperty("RateVitalityLevel2", "2."));
					RATE_VITALITY_LEVEL_3 = Float.parseFloat(vitalitySettings.getProperty("RateVitalityLevel3", "2.5"));
					RATE_VITALITY_LEVEL_4 = Float.parseFloat(vitalitySettings.getProperty("RateVitalityLevel4", "3."));
					RATE_DROP_VITALITY_HERBS = Float.parseFloat(vitalitySettings.getProperty("RateVitalityHerbs", "2."));
					RATE_RECOVERY_VITALITY_PEACE_ZONE = Float.parseFloat(vitalitySettings.getProperty("RateRecoveryPeaceZone", "1."));
					RATE_VITALITY_LOST = Float.parseFloat(vitalitySettings.getProperty("RateVitalityLost", "1."));
					RATE_VITALITY_GAIN = Float.parseFloat(vitalitySettings.getProperty("RateVitalityGain", "1."));
					RATE_RECOVERY_ON_RECONNECT = Float.parseFloat(vitalitySettings.getProperty("RateRecoveryOnReconnect", "4."));
				}
			catch (Exception e)
			{
				e.printStackTrace();
				throw new Error("Failed to Load " + VITALITY_FILE + " File.");
			}
	}
	
	/** ------------------------------------ Main Section - End ----------------------------------------- **/
	
	/** ------------------------------------ Administration Section - Start ----------------------------- **/ 
	
	//-------------------------------------------------------------------------------------------------------
	// GMAccess Settings
	//-------------------------------------------------------------------------------------------------------
	public static int MASTERACCESS_LEVEL;
	public static int MASTERACCESS_NAME_COLOR;
	public static int MASTERACCESS_TITLE_COLOR;
	public static boolean GM_HERO_AURA;
	public static boolean GM_STARTUP_INVULNERABLE;
	public static boolean GM_STARTUP_INVISIBLE;
	public static boolean GM_STARTUP_SILENCE;
	public static boolean GM_STARTUP_AUTO_LIST;
	public static boolean GM_STARTUP_DIET_MODE;
	public static String GM_ADMIN_MENU_STYLE;
	public static boolean GM_ITEM_RESTRICTION;
	public static boolean GM_SKILL_RESTRICTION;
	public static boolean SHOW_GM_LOGIN;
	public static boolean SHOW_ANNOUNCER_NAME;
	
	//======================================================================================================= 
	public static final String GMACCESS_FILE = "./config/administration/gm_access.properties"; 
	//=======================================================================================================
	
	public static void loadGMAccessConfig()
	{
		_log.info("Loading: " + GMACCESS_FILE);
		InputStream is = null;

				// Load GMAccess Properties file (if exists)
				try
				{
					Properties gmSettings = new Properties();
					is = new FileInputStream(new File(GMACCESS_FILE));
					gmSettings.load(is);
					
					MASTERACCESS_LEVEL = Integer.parseInt(gmSettings.getProperty("MasterAccessLevel", "127"));
					MASTERACCESS_NAME_COLOR = Integer.decode(StringUtil.concat("0x", gmSettings.getProperty("MasterNameColor", "00FF00")));
					MASTERACCESS_TITLE_COLOR = Integer.decode(StringUtil.concat("0x", gmSettings.getProperty("MasterTitleColor", "00FF00")));
					GM_HERO_AURA = Boolean.parseBoolean(gmSettings.getProperty("GMHeroAura", "False"));
					GM_STARTUP_INVULNERABLE = Boolean.parseBoolean(gmSettings.getProperty("GMStartupInvulnerable", "False"));
					GM_STARTUP_INVISIBLE = Boolean.parseBoolean(gmSettings.getProperty("GMStartupInvisible", "False"));
					GM_STARTUP_SILENCE = Boolean.parseBoolean(gmSettings.getProperty("GMStartupSilence", "False"));
					GM_STARTUP_AUTO_LIST = Boolean.parseBoolean(gmSettings.getProperty("GMStartupAutoList", "False"));
					GM_STARTUP_DIET_MODE = Boolean.parseBoolean(gmSettings.getProperty("GMStartupDietMode", "False"));
					GM_ADMIN_MENU_STYLE = gmSettings.getProperty("GMAdminMenuStyle", "modern");
					GM_ITEM_RESTRICTION = Boolean.parseBoolean(gmSettings.getProperty("GmItemRestriction", "True"));
					GM_SKILL_RESTRICTION = Boolean.parseBoolean(gmSettings.getProperty("GmSkillRestriction", "True"));
					SHOW_GM_LOGIN = Boolean.parseBoolean(gmSettings.getProperty("ShowGMLogin", "False"));
					SHOW_ANNOUNCER_NAME = Boolean.parseBoolean(gmSettings.getProperty("ShowAnnouncerName", "False"));
				}
			catch (Exception e)
			{
				e.printStackTrace();
				throw new Error("Failed to Load " + GMACCESS_FILE + " File.");
			}
	}
	
	/** ------------------------------------ Administration Section - End -------------------------- **/
	
	/** ------------------------------------ Mods Section - Start --------------------------------------- **/
	
	//-------------------------------------------------------------------------------------------------------
	// Champions Settings
	//-------------------------------------------------------------------------------------------------------
	public static boolean L2JMOD_CHAMPION_ENABLE;
	public static boolean L2JMOD_CHAMPION_PASSIVE;
	public static int L2JMOD_CHAMPION_FREQUENCY;
	public static String L2JMOD_CHAMP_TITLE;
	public static int L2JMOD_CHAMP_MIN_LVL;
	public static int L2JMOD_CHAMP_MAX_LVL;
	public static int L2JMOD_CHAMPION_HP;
	public static int L2JMOD_CHAMPION_REWARDS;
	public static int L2JMOD_CHAMPION_REWARDS_XP;
	public static int L2JMOD_CHAMPION_REWARDS_SP;
	public static int L2JMOD_CHAMPION_ADENAS_REWARDS;
	public static float L2JMOD_CHAMPION_HP_REGEN;
	public static float L2JMOD_CHAMPION_ATK;
	public static float L2JMOD_CHAMPION_SPD_ATK;
	public static int L2JMOD_CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE;
	public static int L2JMOD_CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE;
	public static int L2JMOD_CHAMPION_REWARD_ID;
	public static int L2JMOD_CHAMPION_REWARD_QTY;
	
	//=======================================================================================================
	public static final String CHAMPIONS_FILE = "./config/mods/Champion.properties";
	//=======================================================================================================

	
	public static void loadChampionsConfig()
	{
		_log.info("Loading: " + CHAMPIONS_FILE);
		InputStream is = null;

				// Load Champions Properties file (if exists)
				try
				{
					Properties championsSettings = new Properties();
					is = new FileInputStream(new File(CHAMPIONS_FILE));
					championsSettings.load(is);
					
					L2JMOD_CHAMPION_ENABLE = Boolean.parseBoolean(championsSettings.getProperty("ChampionEnable", "false"));
					L2JMOD_CHAMPION_PASSIVE = Boolean.parseBoolean(championsSettings.getProperty("ChampionPassive", "false"));
					L2JMOD_CHAMPION_FREQUENCY = Integer.parseInt(championsSettings.getProperty("ChampionFrequency", "0"));
					L2JMOD_CHAMP_TITLE = championsSettings.getProperty("ChampionTitle", "Champion");
					L2JMOD_CHAMP_MIN_LVL = Integer.parseInt(championsSettings.getProperty("ChampionMinLevel", "20"));
					L2JMOD_CHAMP_MAX_LVL = Integer.parseInt(championsSettings.getProperty("ChampionMaxLevel", "60"));
					L2JMOD_CHAMPION_HP = Integer.parseInt(championsSettings.getProperty("ChampionHp", "7"));
					L2JMOD_CHAMPION_HP_REGEN = Float.parseFloat(championsSettings.getProperty("ChampionHpRegen", "1."));
					L2JMOD_CHAMPION_REWARDS = Integer.parseInt(championsSettings.getProperty("ChampionRewards", "8"));
					L2JMOD_CHAMPION_REWARDS_XP = Integer.parseInt(championsSettings.getProperty("ChampionRewardsXp", "8"));
					L2JMOD_CHAMPION_REWARDS_SP = Integer.parseInt(championsSettings.getProperty("ChampionRewardsSp", "8"));
					L2JMOD_CHAMPION_ADENAS_REWARDS = Integer.parseInt(championsSettings.getProperty("ChampionAdenasRewards", "1"));
					L2JMOD_CHAMPION_ATK = Float.parseFloat(championsSettings.getProperty("ChampionAtk", "1."));
					L2JMOD_CHAMPION_SPD_ATK = Float.parseFloat(championsSettings.getProperty("ChampionSpdAtk", "1."));
					L2JMOD_CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE = Integer.parseInt(championsSettings.getProperty("ChampionRewardLowerLvlItemChance", "0"));
					L2JMOD_CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE = Integer.parseInt(championsSettings.getProperty("ChampionRewardHigherLvlItemChance", "0"));
					L2JMOD_CHAMPION_REWARD_ID = Integer.parseInt(championsSettings.getProperty("ChampionRewardItemID", "6393"));
					L2JMOD_CHAMPION_REWARD_QTY = Integer.parseInt(championsSettings.getProperty("ChampionRewardItemQty", "1"));
				}
			catch (Exception e)
			{
				e.printStackTrace();
				throw new Error("Failed to Load " + CHAMPIONS_FILE + " File.");
			}
	}
	
	//-------------------------------------------------------------------------------------------------------
	// Wedding Settings
	//-------------------------------------------------------------------------------------------------------
	public static boolean L2JMOD_ALLOW_WEDDING;
	public static int L2JMOD_WEDDING_PRICE;
	public static boolean L2JMOD_WEDDING_PUNISH_INFIDELITY;
	public static boolean L2JMOD_WEDDING_TELEPORT;
	public static int L2JMOD_WEDDING_TELEPORT_PRICE;
	public static int L2JMOD_WEDDING_TELEPORT_DURATION;
	public static boolean L2JMOD_WEDDING_SAMESEX = false;
	public static boolean L2JMOD_WEDDING_FORMALWEAR;
	public static int L2JMOD_WEDDING_DIVORCE_COSTS;
	
	//=======================================================================================================
	public static final String WEDDING_FILE = "./config/mods/Wedding.properties";
	//=======================================================================================================

	
	public static void loadWeddingConfig()
	{
		_log.info("Loading: " + WEDDING_FILE);
		InputStream is = null;

				// Load Wedding Properties file (if exists)
				try
				{
					Properties weddingSettings = new Properties();
					is = new FileInputStream(new File(WEDDING_FILE));
					weddingSettings.load(is);

					L2JMOD_ALLOW_WEDDING = Boolean.parseBoolean(weddingSettings.getProperty("AllowWedding", "False"));
					L2JMOD_WEDDING_PRICE = Integer.parseInt(weddingSettings.getProperty("WeddingPrice", "250000000"));
					L2JMOD_WEDDING_PUNISH_INFIDELITY = Boolean.parseBoolean(weddingSettings.getProperty("WeddingPunishInfidelity", "True"));
					L2JMOD_WEDDING_TELEPORT = Boolean.parseBoolean(weddingSettings.getProperty("WeddingTeleport", "True"));
					L2JMOD_WEDDING_TELEPORT_PRICE = Integer.parseInt(weddingSettings.getProperty("WeddingTeleportPrice", "50000"));
					L2JMOD_WEDDING_TELEPORT_DURATION = Integer.parseInt(weddingSettings.getProperty("WeddingTeleportDuration", "60"));
					L2JMOD_WEDDING_FORMALWEAR = Boolean.parseBoolean(weddingSettings.getProperty("WeddingFormalWear", "True"));
					L2JMOD_WEDDING_DIVORCE_COSTS = Integer.parseInt(weddingSettings.getProperty("WeddingDivorceCosts", "20"));
				}
			catch (Exception e)
			{
				e.printStackTrace();
				throw new Error("Failed to Load " + WEDDING_FILE + " File.");
			}
	}
	
	//==================================================================================
	public static final String	FUN_EVENTS_FILE	= "./config/mods/fun_events.properties";
	//==================================================================================
	// --------------- TVT ----------------------
	public static boolean		TVT_AUTO_STARTUP_ON_BOOT;
	public static boolean		TVT_ALLOW_INTERFERENCE;
	public static boolean		TVT_ALLOW_POTIONS;
	public static boolean		TVT_ALLOW_SUMMON;
	public static boolean		TVT_ON_START_REMOVE_ALL_EFFECTS;
	public static boolean		TVT_ON_START_UNSUMMON_PET;
	public static boolean		TVT_REVIVE_RECOVERY;
	public static boolean		TVT_ANNOUNCE_TEAM_STATS;
	public static boolean		TVT_CLOSE_COLISEUM_DOORS;
	public static boolean		TVT_ALLOW_ENEMY_HEALING;
	public static boolean		TVT_ALLOW_TEAM_CASTING;
	public static boolean		TVT_ALLOW_TEAM_ATTACKING;
	public static boolean		TVT_ANNOUNCE_REGISTRATION_LOC_NPC;
	public static boolean		TVT_ANNOUNCE_SIGNUPS;
	public static boolean		TVT_JOIN_CURSED;
	public static boolean		TVT_PRICE_NO_KILLS;
	public static boolean		TVT_AURA;
	public static String		TVT_EVEN_TEAMS;
	public static boolean		TVT_ANNOUNCE_REWARD;
	public static int			FIRST_TVT_DELAY;
	public static long			TVT_REVIVE_DELAY;

	// --------- CTF --------
	public static boolean		CTF_AUTO_STARTUP_ON_BOOT;
	public static boolean		CTF_REVIVE_RECOVERY;
	public static boolean		CTF_ALLOW_INTERFERENCE;
	public static boolean		CTF_ALLOW_POTIONS;
	public static boolean		CTF_ALLOW_SUMMON;
	public static boolean		CTF_ON_START_REMOVE_ALL_EFFECTS;
	public static boolean		CTF_ON_START_UNSUMMON_PET;
	public static String		CTF_EVEN_TEAMS;
	public static boolean		CTF_ANNOUNCE_TEAM_STATS;
	public static boolean		CTF_JOIN_CURSED;
	public static boolean		CTF_ANNOUNCE_REWARD;
	public static int			FIRST_CTF_DELAY;
	public static long			CTF_REVIVE_DELAY;
	public static boolean		CTF_AURA;
	public static boolean		CTF_ANNOUNCE_REGISTRATION_LOC_NPC;
	public static boolean		CTF_ANNOUNCE_SIGNUPS;

	// ----------- DM ------------
	public static boolean		DM_ALLOW_INTERFERENCE;
	public static boolean		DM_ALLOW_POTIONS;
	public static boolean		DM_ALLOW_SUMMON;
	public static boolean		DM_ON_START_REMOVE_ALL_EFFECTS;
	public static boolean		DM_ON_START_UNSUMMON_PET;
	public static long			DM_REVIVE_DELAY;

	// ----------- VIP -----------
	public static boolean		VIP_ALLOW_INTERFERENCE;
	public static boolean		VIP_ALLOW_POTIONS;
	public static boolean		VIP_ON_START_REMOVE_ALL_EFFECTS;
	public static int			VIP_MIN_LEVEL;
	public static int			VIP_MAX_LEVEL;
	public static int			VIP_MIN_PARTICIPANTS;

	public static boolean		ARENA_ENABLED;
	public static int			ARENA_INTERVAL;
	public static int			ARENA_REWARD_ID;
	public static int			ARENA_REWARD_COUNT;
	public static boolean		FISHERMAN_ENABLED;
	public static int			FISHERMAN_INTERVAL;
	public static int			FISHERMAN_REWARD_ID;
	public static int			FISHERMAN_REWARD_COUNT;

	//=======================================================================================================
	public static final String FUN_FILE = "./config/mods/fun_events.properties";
	//=======================================================================================================
	public static void loadFunEventsConfig()
	{
		_log.info("Loading: " + FUN_FILE);
		InputStream is = null;

			// Load Fun Events Properties file (if exists)
			try
			{
				Properties funEventsSettings = new Properties();
				is = new FileInputStream(new File(FUN_FILE));
				funEventsSettings.load(is);

				// ----------------- DM ---------------
				DM_ALLOW_INTERFERENCE = Boolean.parseBoolean(funEventsSettings.getProperty("DMAllowInterference", "false"));
				DM_ALLOW_POTIONS = Boolean.parseBoolean(funEventsSettings.getProperty("DMAllowPotions", "false"));
				DM_ALLOW_SUMMON = Boolean.parseBoolean(funEventsSettings.getProperty("DMAllowSummon", "false"));
				DM_ON_START_REMOVE_ALL_EFFECTS = Boolean.parseBoolean(funEventsSettings.getProperty("DMOnStartRemoveAllEffects", "true"));
				DM_ON_START_UNSUMMON_PET = Boolean.parseBoolean(funEventsSettings.getProperty("DMOnStartUnsummonPet", "true"));
				DM_REVIVE_DELAY = Long.parseLong(funEventsSettings.getProperty("DMReviveDelay", "20000"));
				if (DM_REVIVE_DELAY < 1000)
					DM_REVIVE_DELAY = 1000; //can't be set less then 1 second
	
				// ----------------- CTF --------------
				FIRST_CTF_DELAY = Integer.parseInt(funEventsSettings.getProperty("FirstCTFEventDelay", "10"));
				CTF_AUTO_STARTUP_ON_BOOT = Boolean.parseBoolean(funEventsSettings.getProperty("CTFAutoStartUpOnBoot", "false"));
				CTF_REVIVE_RECOVERY = Boolean.parseBoolean(funEventsSettings.getProperty("CTFReviveRecovery", "false"));
				CTF_EVEN_TEAMS = funEventsSettings.getProperty("CTFEvenTeams", "BALANCE");
				CTF_ALLOW_INTERFERENCE = Boolean.parseBoolean(funEventsSettings.getProperty("CTFAllowInterference", "false"));
				CTF_ALLOW_POTIONS = Boolean.parseBoolean(funEventsSettings.getProperty("CTFAllowPotions", "false"));
				CTF_ALLOW_SUMMON = Boolean.parseBoolean(funEventsSettings.getProperty("CTFAllowSummon", "false"));
				CTF_ON_START_REMOVE_ALL_EFFECTS = Boolean.parseBoolean(funEventsSettings.getProperty("CTFOnStartRemoveAllEffects", "true"));
				CTF_ON_START_UNSUMMON_PET = Boolean.parseBoolean(funEventsSettings.getProperty("CTFOnStartUnsummonPet", "true"));
				CTF_ANNOUNCE_TEAM_STATS = Boolean.parseBoolean(funEventsSettings.getProperty("CTFAnnounceTeamStats", "false"));
				CTF_JOIN_CURSED = Boolean.parseBoolean(funEventsSettings.getProperty("CTFJoinWithCursedWeapon", "true"));
				CTF_ANNOUNCE_REWARD = Boolean.parseBoolean(funEventsSettings.getProperty("CTFAnnounceReward", "false"));
				CTF_REVIVE_DELAY = Long.parseLong(funEventsSettings.getProperty("CTFReviveDelay", "20000"));
				if (CTF_REVIVE_DELAY < 1000)
					CTF_REVIVE_DELAY = 1000; //can't be set less then 1 second
				CTF_AURA = Boolean.parseBoolean(funEventsSettings.getProperty("CTFAura", "true"));
				CTF_ANNOUNCE_REGISTRATION_LOC_NPC = Boolean.parseBoolean(funEventsSettings.getProperty("CTFAnnounceLocNpc", "true"));
				CTF_ANNOUNCE_SIGNUPS = Boolean.parseBoolean(funEventsSettings.getProperty("CTFAnnounceSignUp", "false"));
	
				// ----------------- TVT ---------------
				FIRST_TVT_DELAY = Integer.parseInt(funEventsSettings.getProperty("FirstTvTEventDelay", "10"));
				TVT_AURA = Boolean.parseBoolean(funEventsSettings.getProperty("TvTAura", "true"));
				TVT_JOIN_CURSED = Boolean.parseBoolean(funEventsSettings.getProperty("TvTJoinWithCursedWeapon", "true"));
				TVT_PRICE_NO_KILLS = Boolean.parseBoolean(funEventsSettings.getProperty("TvTPriceNoKills", "false"));
				TVT_ALLOW_ENEMY_HEALING = Boolean.parseBoolean(funEventsSettings.getProperty("TvTAllowEnemyHealing", "false"));
				TVT_ALLOW_TEAM_CASTING = Boolean.parseBoolean(funEventsSettings.getProperty("TvTAllowTeamCasting", "false"));
				TVT_ALLOW_TEAM_ATTACKING = Boolean.parseBoolean(funEventsSettings.getProperty("TvTAllowTeamAttacking", "false"));
				TVT_CLOSE_COLISEUM_DOORS = Boolean.parseBoolean(funEventsSettings.getProperty("TvTCloseColiseumDoors", "false"));
				TVT_AUTO_STARTUP_ON_BOOT = Boolean.parseBoolean(funEventsSettings.getProperty("TvTAutoStartUpOnBoot", "false"));
				TVT_ALLOW_INTERFERENCE = Boolean.parseBoolean(funEventsSettings.getProperty("TvTAllowInterference", "false"));
				TVT_ALLOW_POTIONS = Boolean.parseBoolean(funEventsSettings.getProperty("TvTAllowPotions", "false"));
				TVT_ALLOW_SUMMON = Boolean.parseBoolean(funEventsSettings.getProperty("TvTAllowSummon", "false"));
				TVT_ON_START_REMOVE_ALL_EFFECTS = Boolean.parseBoolean(funEventsSettings.getProperty("TvTOnStartRemoveAllEffects", "true"));
				TVT_ON_START_UNSUMMON_PET = Boolean.parseBoolean(funEventsSettings.getProperty("TvTOnStartUnsummonPet", "true"));
				TVT_REVIVE_RECOVERY = Boolean.parseBoolean(funEventsSettings.getProperty("TvTReviveRecovery", "false"));
				TVT_ANNOUNCE_TEAM_STATS = Boolean.parseBoolean(funEventsSettings.getProperty("TvTAnnounceTeamStats", "false"));
				TVT_EVEN_TEAMS = funEventsSettings.getProperty("TvTEvenTeams", "BALANCE");
				TVT_ANNOUNCE_SIGNUPS = Boolean.parseBoolean(funEventsSettings.getProperty("TvTAnnounceSignUp", "false"));
				TVT_ANNOUNCE_REGISTRATION_LOC_NPC = Boolean.parseBoolean(funEventsSettings.getProperty("TvTAnnounceLocNpc", "true"));
				TVT_ANNOUNCE_TEAM_STATS = Boolean.parseBoolean(funEventsSettings.getProperty("TvTAnnounceTeamStats", "false"));
				TVT_ANNOUNCE_REWARD = Boolean.parseBoolean(funEventsSettings.getProperty("TvTAnnounceReward", "false"));
				TVT_PRICE_NO_KILLS = Boolean.parseBoolean(funEventsSettings.getProperty("TvTPriceNoKills", "false"));
				TVT_JOIN_CURSED = Boolean.parseBoolean(funEventsSettings.getProperty("TvTJoinWithCursedWeapon", "true"));
				TVT_REVIVE_DELAY = Long.parseLong(funEventsSettings.getProperty("TVTReviveDelay", "20000"));
				if (TVT_REVIVE_DELAY < 1000)
					TVT_REVIVE_DELAY = 1000; //can't be set less then 1 second
	
				// ----------------- VIP ---------------
				VIP_ALLOW_INTERFERENCE = Boolean.parseBoolean(funEventsSettings.getProperty("VIPAllowInterference", "false"));
				VIP_ALLOW_POTIONS = Boolean.parseBoolean(funEventsSettings.getProperty("VIPAllowPotions", "false"));
				VIP_ON_START_REMOVE_ALL_EFFECTS = Boolean.parseBoolean(funEventsSettings.getProperty("VIPOnStartRemoveAllEffects", "true"));
				VIP_MIN_LEVEL = Integer.parseInt(funEventsSettings.getProperty("VIPMinLevel", "1"));
				if (VIP_MIN_LEVEL < 1)
					VIP_MIN_LEVEL = 1; //can't be set less then lvl 1
				VIP_MAX_LEVEL = Integer.parseInt(funEventsSettings.getProperty("VIPMaxLevel", "85"));
				if (VIP_MAX_LEVEL < VIP_MIN_LEVEL)
					VIP_MAX_LEVEL = VIP_MIN_LEVEL + 1; //can't be set less then Min Level
				VIP_MIN_PARTICIPANTS = Integer.parseInt(funEventsSettings.getProperty("VIPMinParticipants", "10"));
				if (VIP_MIN_PARTICIPANTS < 10)
					VIP_MIN_PARTICIPANTS = 10; //can't be set less then lvl 10
	
				// --------------------- Arena ------------------
				ARENA_ENABLED = Boolean.parseBoolean(funEventsSettings.getProperty("ArenaEnabled", "false"));
				ARENA_INTERVAL = Integer.parseInt(funEventsSettings.getProperty("ArenaInterval", "60"));
				ARENA_REWARD_ID = Integer.parseInt(funEventsSettings.getProperty("ArenaRewardId", "57"));
				ARENA_REWARD_COUNT = Integer.parseInt(funEventsSettings.getProperty("ArenaRewardCount", "100"));
	
				// --------------------- Fisherman ------------------
				FISHERMAN_ENABLED = Boolean.parseBoolean(funEventsSettings.getProperty("FishermanEnabled", "false"));
				FISHERMAN_INTERVAL = Integer.parseInt(funEventsSettings.getProperty("FishermanInterval", "60"));
				FISHERMAN_REWARD_ID = Integer.parseInt(funEventsSettings.getProperty("FishermanRewardId", "57"));
				FISHERMAN_REWARD_COUNT = Integer.parseInt(funEventsSettings.getProperty("FishermanRewardCount", "100"));
			}
		catch (Exception e)
		{
			_log.warning(e.getMessage()+ e);
			throw new Error("Failed to Load " + FUN_EVENTS_FILE + " File.");
		}
	}
	
	//========================================================================
	public static final String	JAIL_FILE	= "./config/mods/jail.properties";
	//=========================================================================
	
	// ----------- Jail Spawn System -----------------------
	public static int			REQUIRED_JAIL_POINTS;					// ammount of jail points player will need to get to leave jail
	public static int			POINTS_PER_KILL;						// how many points a player wil receive per each killed mob in jail
	public static int			JAIL_POINT_CHANCE;						// percentage of change to receive a jail point
	public static int			POINTS_LOST_PER_DEATH;					// how many jail points player will loose if die in jail
	public static boolean		JAIL_IS_PVP;							// jail must be a pvp zone?
	public static boolean		ALLOW_JAILMANAGER;						// enables/disables jail manager NPC
	public static boolean		REDUCE_JAIL_POINTS_ON_DEATH;			// should we reduce player jail points on death?
	public static boolean		NOTIY_ADMINS_OF_ILLEGAL_ACTION;		// enables/disables admin notification of illegal jail actions
	public static boolean		JAIL_SPAWN_SYSTEM;						// enables/disables jail spawn system

	// ---------------- Jail Chat System -----------------------
	public static boolean		JAIL_DISABLE_NORMAL_CHAT;				// jail must disable normal chat?
	public static boolean		JAIL_DISABLE_SHOUT_CHAT;				// jail must disable shout chat?
	public static boolean		JAIL_DISABLE_TRADE_CHAT;				// jail must disable trade chat ?
	public static boolean		JAIL_DISABLE_TELL_CHAT;				// jail must disable tell chat ?
	public static boolean		JAIL_DISABLE_PARTY_CHAT;				// jail must disable party chat ?
	public static boolean		JAIL_DISABLE_ALLIANCE_CHAT;			// jail must disable alliance chat ?
	public static boolean		JAIL_DISABLE_HERO_CHAT;				// jail must disable hero chat ?
	public static boolean		JAIL_DISABLE_CLAN_CHAT;				// jail must disable clan chat ?
	public static boolean		JAIL_DISABLE_ANY_CHAT;					// jail must disable all chat ?

	//**********************************************************************************************
	public static void loadJailConfig()
	{
		_log.info("Loading: " + JAIL_FILE);
		InputStream is = null;

			// Load Fun Events Properties file (if exists)
			try
			{
				Properties jailSettings = new Properties();
				is = new FileInputStream(new File(JAIL_FILE));
				jailSettings.load(is);

				// --------------- Jail Spawn System -----------------------------
				JAIL_POINT_CHANCE = Integer.parseInt(jailSettings.getProperty("PointChance", "100"));
				POINTS_PER_KILL = Integer.parseInt(jailSettings.getProperty("PointsPerKill", "1"));
				POINTS_LOST_PER_DEATH = Integer.parseInt(jailSettings.getProperty("PointsLostPerDeath", "0"));
				REQUIRED_JAIL_POINTS = Integer.parseInt(jailSettings.getProperty("RequiredJailPoints", "20"));
				JAIL_SPAWN_SYSTEM = Boolean.parseBoolean(jailSettings.getProperty("EnableJailSpawnSystem", "false"));
				NOTIY_ADMINS_OF_ILLEGAL_ACTION = Boolean.parseBoolean(jailSettings.getProperty("NotifyAdminsOfIllegalAction", "false"));
				ALLOW_JAILMANAGER = Boolean.parseBoolean(jailSettings.getProperty("AllowJailManager", "true"));
				REDUCE_JAIL_POINTS_ON_DEATH = Boolean.parseBoolean(jailSettings.getProperty("ReduceJailPointsOnDeath", "true"));
	
				// --------- Jail Pvp ----------------
				JAIL_IS_PVP = Boolean.parseBoolean(jailSettings.getProperty("JailIsPvpZone", "true"));
	
				// ----------- Jail Chat System ----------------------------------
				JAIL_DISABLE_NORMAL_CHAT = Boolean.parseBoolean(jailSettings.getProperty("JailDisableNormalChat", "false"));
				JAIL_DISABLE_SHOUT_CHAT = Boolean.parseBoolean(jailSettings.getProperty("JailDisableShoutChat", "false"));
				JAIL_DISABLE_TELL_CHAT = Boolean.parseBoolean(jailSettings.getProperty("JailDisableTellChat", "false"));
				JAIL_DISABLE_TRADE_CHAT = Boolean.parseBoolean(jailSettings.getProperty("JailDisableTradeChat", "false"));
				JAIL_DISABLE_HERO_CHAT = Boolean.parseBoolean(jailSettings.getProperty("JailDisableHeroChat", "false"));
				JAIL_DISABLE_CLAN_CHAT = Boolean.parseBoolean(jailSettings.getProperty("JailDisableClanChat", "false"));
				JAIL_DISABLE_ALLIANCE_CHAT = Boolean.parseBoolean(jailSettings.getProperty("JailDisableAllianceChat", "false"));
				JAIL_DISABLE_PARTY_CHAT = Boolean.parseBoolean(jailSettings.getProperty("JailDisablePartyChat", "false"));
				JAIL_DISABLE_ANY_CHAT = Boolean.parseBoolean(jailSettings.getProperty("JailDisableAnyChat", "false"));
			}
		catch (Exception e)
		{
			_log.warning(e.getMessage() + e);
			throw new Error("Failed to Load " + JAIL_FILE + " File.");
		}
	}

	//-------------------------------------------------------------------------------------------------------
	// TownWar Settings
	//-------------------------------------------------------------------------------------------------------
    public static int		TW_TOWN_ID;
    public static boolean 	TW_ALL_TOWNS;
    public static int		TW_ITEM_ID;
    public static int		TW_ITEM_AMOUNT;
    public static boolean 	TW_ALLOW_KARMA;
    public static boolean 	TW_DISABLE_GK;
    public static boolean 	TW_RESS_ON_DIE;
	
	//=======================================================================================================
	public static final String TOWNWAR_FILE = "./config/mods/TownWar.properties";
	//=======================================================================================================

	
	public static void loadTownWarConfig()
	{
		_log.info("Loading: " + TOWNWAR_FILE);
		InputStream is = null;

				// Load TownWar Properties file (if exists)
				try
				{
					Properties townwarSettings = new Properties();
					is = new FileInputStream(new File(TOWNWAR_FILE));
					townwarSettings.load(is);

	                TW_TOWN_ID = Integer.parseInt(townwarSettings.getProperty("TWTownId", "9"));	                
	                TW_ALL_TOWNS = Boolean.parseBoolean(townwarSettings.getProperty("TWAllTowns", "False"));
	                TW_ITEM_ID = Integer.parseInt(townwarSettings.getProperty("TownWarItemId", "57"));
	                TW_ITEM_AMOUNT = Integer.parseInt(townwarSettings.getProperty("TownWarItemAmount", "5000"));
	                TW_ALLOW_KARMA = Boolean.parseBoolean(townwarSettings.getProperty("AllowKarma", "False"));
	                TW_DISABLE_GK = Boolean.parseBoolean(townwarSettings.getProperty("DisableGK", "True"));
	                TW_RESS_ON_DIE = Boolean.parseBoolean(townwarSettings.getProperty("SendRessOnDeath", "False"));
				}
			catch (Exception e)
			{
				e.printStackTrace();
				throw new Error("Failed to Load " + TOWNWAR_FILE + " File.");
			}
	}
	
	 // *******************************************************************************************
	 public static final String OFFLINE_TRADE_FILE = "./config/mods/offline_trade.properties";
	 // *******************************************************************************************
	 public static boolean OFFLINE_TRADE_ENABLE; 
	 public static boolean OFFLINE_CRAFT_ENABLE; 
	 public static boolean OFFLINE_SET_NAME_COLOR; 
	 public static int OFFLINE_NAME_COLOR;
	
	 public static void loadOfflineTradeConfig()
	 {
		_log.info("Loading: " + OFFLINE_TRADE_FILE);
		InputStream is = null;
		
				// Load OfflineTrade Properties file (if exists)
	     		try
	     		{
	     			Properties offlinetrade = new Properties();
					is = new FileInputStream(new File(OFFLINE_TRADE_FILE));
					offlinetrade.load(is);
	
					OFFLINE_TRADE_ENABLE = Boolean.parseBoolean(offlinetrade.getProperty("OfflineTradeEnable", "false"));
	       			OFFLINE_CRAFT_ENABLE = Boolean.parseBoolean(offlinetrade.getProperty("OfflineCraftEnable", "false"));
	       			OFFLINE_SET_NAME_COLOR = Boolean.parseBoolean(offlinetrade.getProperty("OfflineSetNameColor", "false"));
	       			OFFLINE_NAME_COLOR = Integer.parseInt(offlinetrade.getProperty("OfflineNameColor", "808080"));
	     		}
			catch (Exception e)
			{
				e.printStackTrace();
				throw new Error("Failed to Load " + OFFLINE_TRADE_FILE + " File.");
			}
	  }

	// *******************************************************************************************
	public static final String CLASSMASTER_FILE = "./config/mods/class_master.properties";
	// *******************************************************************************************
	public static boolean				ALT_SPAWN_CLASS_MASTER;
	public static boolean				ALT_CLASS_MASTER_STRIDER_UPDATE;
	public static String				ALT_CLASS_MASTER_SETTINGS_LINE;
	public static ClassMasterSettings	ALT_CLASS_MASTER_SETTINGS;
	
	public static void loadClassMasterConfig()
	{
		_log.info("Loading: " + CLASSMASTER_FILE);
		InputStream is = null;
		
			// Load ClassMaster Properties file (if exists)
			try
			{
     			Properties	ClassMasterSettings = new Properties();
				is = new FileInputStream(new File(CLASSMASTER_FILE));
				ClassMasterSettings.load(is);

				ALT_SPAWN_CLASS_MASTER = Boolean.parseBoolean(ClassMasterSettings.getProperty("SpawnClassMaster", "False"));
				ALT_CLASS_MASTER_STRIDER_UPDATE = Boolean.parseBoolean(ClassMasterSettings.getProperty("ClassMasterUpdateStrider", "False"));
				if (!ClassMasterSettings.getProperty("ConfigClassMaster").trim().equalsIgnoreCase("False"))
					ALT_CLASS_MASTER_SETTINGS_LINE = ClassMasterSettings.getProperty("ConfigClassMaster");

				ALT_CLASS_MASTER_SETTINGS = new ClassMasterSettings(ALT_CLASS_MASTER_SETTINGS_LINE);
			}
		catch (Exception e)
		{
				e.printStackTrace();
				throw new Error("Failed to Load " + CLASSMASTER_FILE + " File.");
		}
	} 

	/** ------------------------------------ Mods Section - End ----------------------------------------- **/
	
	//-------------------------------------------------------------------------------------------------------
	// Login Server Settings
	//-------------------------------------------------------------------------------------------------------
	
	
	//=======================================================================================================
	public static final String LOGIN_CONFIGURATION_FILE = "./config/main/loginserver.properties";
	//=======================================================================================================
	
	public static void loadLSConfig()
	{
		_log.info("Loading: " + LOGIN_CONFIGURATION_FILE);
		InputStream is = null;

			try
			{
					Properties serverSettings = new Properties();
					is = new FileInputStream(new File(LOGIN_CONFIGURATION_FILE));
					serverSettings.load(is);

					GAME_SERVER_LOGIN_HOST = serverSettings.getProperty("LoginHostname","*");
					GAME_SERVER_LOGIN_PORT = Integer.parseInt(serverSettings.getProperty("LoginPort","9013"));

					LOGIN_BIND_ADDRESS = serverSettings.getProperty("LoginserverHostname", "*");
					PORT_LOGIN = Integer.parseInt(serverSettings.getProperty("LoginserverPort", "2106"));

					DEBUG = Boolean.parseBoolean(serverSettings.getProperty("Debug", "false"));
					PACKET_HANDLER_DEBUG = Boolean.parseBoolean(serverSettings.getProperty("PacketHandlerDebug", "false"));
					DEVELOPER = Boolean.parseBoolean(serverSettings.getProperty("Developer", "false"));
					ASSERT = Boolean.parseBoolean(serverSettings.getProperty("Assert", "false"));

					ACCEPT_NEW_GAMESERVER = Boolean.parseBoolean(serverSettings.getProperty("AcceptNewGameServer","True"));
					REQUEST_ID = Integer.parseInt(serverSettings.getProperty("RequestServerID","0"));
					ACCEPT_ALTERNATE_ID = Boolean.parseBoolean(serverSettings.getProperty("AcceptAlternateID","True"));

					LOGIN_TRY_BEFORE_BAN = Integer.parseInt(serverSettings.getProperty("LoginTryBeforeBan", "10"));
					LOGIN_BLOCK_AFTER_BAN = Integer.parseInt(serverSettings.getProperty("LoginBlockAfterBan", "600"));

					LOG_LOGIN_CONTROLLER = Boolean.parseBoolean(serverSettings.getProperty("LogLoginController", "true"));

					DATAPACK_ROOT = new File(serverSettings.getProperty("DatapackRoot", ".")).getCanonicalFile(); //FIXME: in login?

					INTERNAL_HOSTNAME = serverSettings.getProperty("InternalHostname", "localhost");
					EXTERNAL_HOSTNAME = serverSettings.getProperty("ExternalHostname", "localhost");

					DATABASE_DRIVER = serverSettings.getProperty("Driver", "com.mysql.jdbc.Driver");
					DATABASE_URL = serverSettings.getProperty("URL", "jdbc:mysql://localhost/L2Emu_DB");
					DATABASE_LOGIN = serverSettings.getProperty("Login", "root");
					DATABASE_PASSWORD = serverSettings.getProperty("Password", "");
					DATABASE_MAX_CONNECTIONS = Integer.parseInt(serverSettings.getProperty("MaximumDbConnections", "10"));

					SHOW_LICENCE = Boolean.parseBoolean(serverSettings.getProperty("ShowLicence", "true"));
					IP_UPDATE_TIME = Integer.parseInt(serverSettings.getProperty("IpUpdateTime","15"));
					FORCE_GGAUTH = Boolean.parseBoolean(serverSettings.getProperty("ForceGGAuth", "false"));

					AUTO_CREATE_ACCOUNTS = Boolean.parseBoolean(serverSettings.getProperty("AutoCreateAccounts","True"));

					FLOOD_PROTECTION = Boolean.parseBoolean(serverSettings.getProperty("EnableFloodProtection","True"));
					FAST_CONNECTION_LIMIT = Integer.parseInt(serverSettings.getProperty("FastConnectionLimit","15"));
					NORMAL_CONNECTION_TIME = Integer.parseInt(serverSettings.getProperty("NormalConnectionTime","700"));
					FAST_CONNECTION_TIME = Integer.parseInt(serverSettings.getProperty("FastConnectionTime","350"));
					MAX_CONNECTION_PER_IP = Integer.parseInt(serverSettings.getProperty("MaxConnectionPerIP","50"));
			}
			catch (Exception e)
			{
				e.printStackTrace();
				throw new Error("Failed to Load " + LOGIN_CONFIGURATION_FILE + " File.");
			}
	}
	
	public static class ClassMasterSettings
	{
		private FastMap<Integer, FastMap<Integer, Integer>>	_claimItems;
		private FastMap<Integer, FastMap<Integer, Integer>>	_rewardItems;
		private FastMap<Integer, Boolean>					_allowedClassChange;

		public ClassMasterSettings(String _configLine)
		{
			_claimItems = new FastMap<Integer, FastMap<Integer, Integer>>();
			_rewardItems = new FastMap<Integer, FastMap<Integer, Integer>>();
			_allowedClassChange = new FastMap<Integer, Boolean>();
			if (_configLine != null)
				parseConfigLine(_configLine.trim());
		}

		private void parseConfigLine(String _configLine)
		{
			StringTokenizer st = new StringTokenizer(_configLine, ";");

			while (st.hasMoreTokens())
			{
				// get allowed class change
				int job = Integer.parseInt(st.nextToken());

				_allowedClassChange.put(job, true);

				FastMap<Integer, Integer> _items = new FastMap<Integer, Integer>();
				// parse items needed for class change
				if (st.hasMoreTokens())
				{
					StringTokenizer st2 = new StringTokenizer(st.nextToken(), "[],");

					while (st2.hasMoreTokens())
					{
						StringTokenizer st3 = new StringTokenizer(st2.nextToken(), "()");
						int _itemId = Integer.parseInt(st3.nextToken());
						int _quantity = Integer.parseInt(st3.nextToken());
						_items.put(_itemId, _quantity);
					}
				}

				_claimItems.put(job, _items);

				_items = new FastMap<Integer, Integer>();
				// parse gifts after class change
				if (st.hasMoreTokens())
				{
					StringTokenizer st2 = new StringTokenizer(st.nextToken(), "[],");

					while (st2.hasMoreTokens())
					{
						StringTokenizer st3 = new StringTokenizer(st2.nextToken(), "()");
						int _itemId = Integer.parseInt(st3.nextToken());
						int _quantity = Integer.parseInt(st3.nextToken());
						_items.put(_itemId, _quantity);
					}
				}

				_rewardItems.put(job, _items);
			}
		}

		public boolean isAllowed(int job)
		{
			if (_allowedClassChange == null)
				return false;
			if (_allowedClassChange.containsKey(job))
				return _allowedClassChange.get(job);

			return false;
		}

		public FastMap<Integer, Integer> getRewardItems(int job)
		{
			if (_rewardItems.containsKey(job))
				return _rewardItems.get(job);

			return null;
		}

		public FastMap<Integer, Integer> getRequireItems(int job)
		{
			if (_claimItems.containsKey(job))
				return _claimItems.get(job);

			return null;
		}

	}
	
	public static void loadAll()
	{
		if(Server.serverMode == Server.MODE_LOGINSERVER)
		{
			Util.printSection("Configurations");
			loadLSConfig();
			loadTelnetConfig();
		}
		
		if(Server.serverMode == Server.MODE_GAMESERVER)
		{
			// Network Section
			Util.printSection("Network");
			loadHexID();
			loadNetworkConfig();
			loadTelnetConfig();
		
			// Main Section
			Util.printSection("Main");
			loadGSConfig();
			loadIDFactoryConfig();
			loadGeoDataConfig();
			loadRatesConfig();
			loadPvpConfig();
			loadEnchantConfig();
			loadFloodProtectorConfig();
			loadOlympiadConfig();
			loadManorConfig();
			loadLotteryConfig();
			loadFeatureConfig();
			loadNpcConfig();
			loadSkillsConfig();
			loadClansConfig();
			loadAltConfig();
			loadOptionsConfig();
			loadVitalityConfig();
			loadCustomConfig();
		
			// Administration Section
			Util.printSection("Administration");
			loadGMAccessConfig();
		
			// Mods Section
			Util.printSection("Mods");
			loadChampionsConfig();
			loadWeddingConfig();
			loadFunEventsConfig();
			loadJailConfig();
			loadTownWarConfig();
			loadOfflineTradeConfig();
			loadClassMasterConfig();
		
			// Versionning Section
			Util.printSection("Versionning");
			loadBuildInfoConfig();
			loadBuildDateConfig();
			loadDatapackBuildConfig();
		}
	}

	/**
	 * Set a new value to a game parameter from the admin console.
	 * @param pName (String) : name of the parameter to change
	 * @param pValue (String) : new value of the parameter
	 * @return boolean : true if modification has been made
	 * @link useAdminCommand
	 */
	public static boolean setParameterValue(String pName, String pValue)
	{
		if (pName.equalsIgnoreCase("RateXp")) RATE_XP = Float.parseFloat(pValue);
		else if (pName.equalsIgnoreCase("RateSp")) RATE_SP = Float.parseFloat(pValue);
		else if (pName.equalsIgnoreCase("RatePartyXp")) RATE_PARTY_XP = Float.parseFloat(pValue);
		else if (pName.equalsIgnoreCase("RatePartySp")) RATE_PARTY_SP = Float.parseFloat(pValue);
		else if (pName.equalsIgnoreCase("RateQuestsReward")) RATE_QUESTS_REWARD = Float.parseFloat(pValue);
		else if (pName.equalsIgnoreCase("RateDropAdena")) RATE_DROP_ADENA = Float.parseFloat(pValue);
		else if (pName.equalsIgnoreCase("RateConsumableCost")) RATE_CONSUMABLE_COST = Float.parseFloat(pValue);
		else if (pName.equalsIgnoreCase("RateExtractFish")) RATE_EXTR_FISH = Float.parseFloat(pValue);
		else if (pName.equalsIgnoreCase("RateDropItems")) RATE_DROP_ITEMS = Float.parseFloat(pValue);
		else if (pName.equalsIgnoreCase("RateRaidDropItems")) RATE_DROP_ITEMS_BY_RAID = Float.parseFloat(pValue);
		else if (pName.equalsIgnoreCase("RateDropSpoil")) RATE_DROP_SPOIL = Float.parseFloat(pValue);
		else if (pName.equalsIgnoreCase("RateDropManor")) RATE_DROP_MANOR = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("RateDropQuest")) RATE_DROP_QUEST = Float.parseFloat(pValue);
		else if (pName.equalsIgnoreCase("RateKarmaExpLost")) RATE_KARMA_EXP_LOST = Float.parseFloat(pValue);
		else if (pName.equalsIgnoreCase("RateSiegeGuardsPrice")) RATE_SIEGE_GUARDS_PRICE = Float.parseFloat(pValue);
		else if (pName.equalsIgnoreCase("PlayerDropLimit")) PLAYER_DROP_LIMIT = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("PlayerRateDrop")) PLAYER_RATE_DROP = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("PlayerRateDropItem")) PLAYER_RATE_DROP_ITEM = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("PlayerRateDropEquip")) PLAYER_RATE_DROP_EQUIP = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("PlayerRateDropEquipWeapon")) PLAYER_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(pValue);

		else if (pName.equalsIgnoreCase("KarmaDropLimit")) KARMA_DROP_LIMIT = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("KarmaRateDrop")) KARMA_RATE_DROP = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("KarmaRateDropItem")) KARMA_RATE_DROP_ITEM = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("KarmaRateDropEquip")) KARMA_RATE_DROP_EQUIP = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("KarmaRateDropEquipWeapon")) KARMA_RATE_DROP_EQUIP_WEAPON = Integer.parseInt(pValue);

		else if (pName.equalsIgnoreCase("AutoDestroyDroppedItemAfter")) AUTODESTROY_ITEM_AFTER = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("DestroyPlayerDroppedItem")) DESTROY_DROPPED_PLAYER_ITEM = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("DestroyEquipableItem")) DESTROY_EQUIPABLE_PLAYER_ITEM = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("SaveDroppedItem")) SAVE_DROPPED_ITEM = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("EmptyDroppedItemTableAfterLoad")) EMPTY_DROPPED_ITEM_TABLE_AFTER_LOAD = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("SaveDroppedItemInterval")) SAVE_DROPPED_ITEM_INTERVAL = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("ClearDroppedItemTable")) CLEAR_DROPPED_ITEM_TABLE = Boolean.parseBoolean(pValue);

		else if (pName.equalsIgnoreCase("PreciseDropCalculation")) PRECISE_DROP_CALCULATION = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("MultipleItemDrop")) MULTIPLE_ITEM_DROP = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("CoordSynchronize")) COORD_SYNCHRONIZE = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("DeleteCharAfterDays")) DELETE_DAYS = Integer.parseInt(pValue);

		else if (pName.equalsIgnoreCase("AllowDiscardItem")) ALLOW_DISCARDITEM = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("AllowFreight")) ALLOW_FREIGHT = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("AllowWarehouse")) ALLOW_WAREHOUSE = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("AllowWear")) ALLOW_WEAR = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("WearDelay")) WEAR_DELAY = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("WearPrice")) WEAR_PRICE = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("AllowWater")) ALLOW_WATER = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("AllowRentPet")) ALLOW_RENTPET = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("AllowBoat")) ALLOW_BOAT = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("AllowCursedWeapons")) ALLOW_CURSED_WEAPONS = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("AllowManor")) ALLOW_MANOR = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("AllowNpcWalkers")) ALLOW_NPC_WALKERS = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("AllowPetWalkers")) ALLOW_PET_WALKERS = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("BypassValidation")) BYPASS_VALIDATION = Boolean.parseBoolean(pValue);

		else if (pName.equalsIgnoreCase("CommunityType")) COMMUNITY_TYPE = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("BBSShowPlayerList")) BBS_SHOW_PLAYERLIST = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("BBSDefault")) BBS_DEFAULT = pValue;
		else if (pName.equalsIgnoreCase("ShowLevelOnCommunityBoard")) SHOW_LEVEL_COMMUNITYBOARD = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("ShowStatusOnCommunityBoard")) SHOW_STATUS_COMMUNITYBOARD = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("NamePageSizeOnCommunityBoard")) NAME_PAGE_SIZE_COMMUNITYBOARD = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("NamePerRowOnCommunityBoard")) NAME_PER_ROW_COMMUNITYBOARD = Integer.parseInt(pValue);

		else if (pName.equalsIgnoreCase("ShowServerNews")) SERVER_NEWS = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("ShowMonsterLevel")) SHOW_MONSTER_LVL = Boolean.parseBoolean(pValue);

		else if (pName.equalsIgnoreCase("ForceInventoryUpdate")) FORCE_INVENTORY_UPDATE = Boolean.parseBoolean(pValue);

		else if (pName.equalsIgnoreCase("AutoDeleteInvalidQuestData")) AUTODELETE_INVALID_QUEST_DATA = Boolean.parseBoolean(pValue);

		else if (pName.equalsIgnoreCase("MaximumOnlineUsers")) MAXIMUM_ONLINE_USERS = Integer.parseInt(pValue);

		else if (pName.equalsIgnoreCase("ZoneTown")) ZONE_TOWN = Integer.parseInt(pValue);

		else if (pName.equalsIgnoreCase("MaximumUpdateDistance")) MINIMUM_UPDATE_DISTANCE = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("MinimumUpdateTime")) MINIMUN_UPDATE_TIME = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("CheckKnownList")) CHECK_KNOWN = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("KnownListForgetDelay")) KNOWNLIST_FORGET_DELAY = Integer.parseInt(pValue);

		else if (pName.equalsIgnoreCase("UseDeepBlueDropRules")) DEEPBLUE_DROP_RULES = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("AllowGuards")) GUARD_ATTACK_AGGRO_MOB = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("CancelLesserEffect")) EFFECT_CANCELING = Boolean.parseBoolean(pValue);

		else if (pName.equalsIgnoreCase("MaximumSlotsForNoDwarf")) INVENTORY_MAXIMUM_NO_DWARF = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("MaximumSlotsForDwarf")) INVENTORY_MAXIMUM_DWARF = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("MaximumSlotsForGMPlayer")) INVENTORY_MAXIMUM_GM = Integer.parseInt(pValue);

		else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForNoDwarf")) WAREHOUSE_SLOTS_NO_DWARF = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForDwarf")) WAREHOUSE_SLOTS_DWARF = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("MaximumWarehouseSlotsForClan")) WAREHOUSE_SLOTS_CLAN = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("MaximumFreightSlots")) FREIGHT_SLOTS = Integer.parseInt(pValue);

		else if (pName.equalsIgnoreCase("EnchantChanceWeapon")) ENCHANT_CHANCE_WEAPON = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("EnchantChanceArmor")) ENCHANT_CHANCE_ARMOR = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("EnchantChanceJewelry")) ENCHANT_CHANCE_JEWELRY = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("EnchantMaxWeapon")) ENCHANT_MAX_WEAPON = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("EnchantMaxArmor")) ENCHANT_MAX_ARMOR = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("EnchantMaxJewelry")) ENCHANT_MAX_JEWELRY = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("EnchantSafeMax")) ENCHANT_SAFE_MAX = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("EnchantSafeMaxFull")) ENCHANT_SAFE_MAX_FULL = Integer.parseInt(pValue);

		else if (pName.equalsIgnoreCase("AugmentationNGSkillChance")) AUGMENTATION_NG_SKILL_CHANCE = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("AugmentationNGGlowChance")) AUGMENTATION_NG_GLOW_CHANCE = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("AugmentationMidSkillChance")) AUGMENTATION_MID_SKILL_CHANCE = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("AugmentationMidGlowChance")) AUGMENTATION_MID_GLOW_CHANCE = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("AugmentationHighSkillChance")) AUGMENTATION_HIGH_SKILL_CHANCE = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("AugmentationHighGlowChance")) AUGMENTATION_HIGH_GLOW_CHANCE = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("AugmentationTopSkillChance")) AUGMENTATION_TOP_SKILL_CHANCE = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("AugmentationTopGlowChance")) AUGMENTATION_TOP_GLOW_CHANCE = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("AugmentationBaseStatChance")) AUGMENTATION_BASESTAT_CHANCE = Integer.parseInt(pValue);

		else if (pName.equalsIgnoreCase("HpRegenMultiplier")) HP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
		else if (pName.equalsIgnoreCase("MpRegenMultiplier")) MP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
		else if (pName.equalsIgnoreCase("CpRegenMultiplier")) CP_REGEN_MULTIPLIER = Double.parseDouble(pValue);

		else if (pName.equalsIgnoreCase("RaidHpRegenMultiplier")) RAID_HP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
		else if (pName.equalsIgnoreCase("RaidMpRegenMultiplier")) RAID_MP_REGEN_MULTIPLIER = Double.parseDouble(pValue);
		else if (pName.equalsIgnoreCase("RaidPDefenceMultiplier")) RAID_PDEFENCE_MULTIPLIER = Double.parseDouble(pValue) /100;
		else if (pName.equalsIgnoreCase("RaidMDefenceMultiplier")) RAID_MDEFENCE_MULTIPLIER = Double.parseDouble(pValue) /100;
		else if (pName.equalsIgnoreCase("RaidMinionRespawnTime")) RAID_MINION_RESPAWN_TIMER =Integer.parseInt(pValue);

		else if (pName.equalsIgnoreCase("StartingAdena")) STARTING_ADENA = Long.parseLong(pValue);
		else if (pName.equalsIgnoreCase("UnstuckInterval")) UNSTUCK_INTERVAL = Integer.parseInt(pValue);

		else if (pName.equalsIgnoreCase("PlayerSpawnProtection")) PLAYER_SPAWN_PROTECTION = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("PlayerFakeDeathUpProtection")) PLAYER_FAKEDEATH_UP_PROTECTION = Integer.parseInt(pValue);

		else if (pName.equalsIgnoreCase("RestorePlayerInstance")) RESTORE_PLAYER_INSTANCE = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("AllowSummonToInstance")) ALLOW_SUMMON_TO_INSTANCE = Boolean.parseBoolean(pValue);

		else if (pName.equalsIgnoreCase("PartyXpCutoffMethod")) PARTY_XP_CUTOFF_METHOD = pValue;
		else if (pName.equalsIgnoreCase("PartyXpCutoffPercent")) PARTY_XP_CUTOFF_PERCENT = Double.parseDouble(pValue);
		else if (pName.equalsIgnoreCase("PartyXpCutoffLevel")) PARTY_XP_CUTOFF_LEVEL = Integer.parseInt(pValue);

		else if (pName.equalsIgnoreCase("RespawnRestoreCP")) RESPAWN_RESTORE_CP = Double.parseDouble(pValue) / 100;
		else if (pName.equalsIgnoreCase("RespawnRestoreHP")) RESPAWN_RESTORE_HP = Double.parseDouble(pValue) / 100;
		else if (pName.equalsIgnoreCase("RespawnRestoreMP")) RESPAWN_RESTORE_MP = Double.parseDouble(pValue) / 100;

		else if (pName.equalsIgnoreCase("MaxPvtStoreSellSlotsDwarf")) MAX_PVTSTORESELL_SLOTS_DWARF = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("MaxPvtStoreSellSlotsOther")) MAX_PVTSTORESELL_SLOTS_OTHER = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("MaxPvtStoreBuySlotsDwarf")) MAX_PVTSTOREBUY_SLOTS_DWARF = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("MaxPvtStoreBuySlotsOther")) MAX_PVTSTOREBUY_SLOTS_OTHER = Integer.parseInt(pValue);

		else if (pName.equalsIgnoreCase("StoreSkillCooltime")) STORE_SKILL_COOLTIME = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("SubclassStoreSkillCooltime")) SUBCLASS_STORE_SKILL_COOLTIME = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("AnnounceMammonSpawn")) ANNOUNCE_MAMMON_SPAWN = Boolean.parseBoolean(pValue);

		else if (pName.equalsIgnoreCase("AltGameTiredness")) ALT_GAME_TIREDNESS = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("AltGameCreation")) ALT_GAME_CREATION = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("AltGameCreationSpeed")) ALT_GAME_CREATION_SPEED = Double.parseDouble(pValue);
		else if (pName.equalsIgnoreCase("AltGameCreationXpRate")) ALT_GAME_CREATION_XP_RATE = Double.parseDouble(pValue);
		else if (pName.equalsIgnoreCase("AltGameCreationRareXpSpRate")) ALT_GAME_CREATION_RARE_XPSP_RATE = Double.parseDouble(pValue);
		else if (pName.equalsIgnoreCase("AltGameCreationSpRate")) ALT_GAME_CREATION_SP_RATE = Double.parseDouble(pValue);
		else if (pName.equalsIgnoreCase("AltWeightLimit")) ALT_WEIGHT_LIMIT = Double.parseDouble(pValue);
		else if (pName.equalsIgnoreCase("AltBlacksmithUseRecipes")) ALT_BLACKSMITH_USE_RECIPES = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("AltGameSkillLearn")) ALT_GAME_SKILL_LEARN = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("RemoveCastleCirclets")) REMOVE_CASTLE_CIRCLETS = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("ReputationScorePerKill")) REPUTATION_SCORE_PER_KILL = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("AltGameCancelByHit"))
		{
			ALT_GAME_CANCEL_BOW = pValue.equalsIgnoreCase("bow") || pValue.equalsIgnoreCase("all");
			ALT_GAME_CANCEL_CAST = pValue.equalsIgnoreCase("cast") || pValue.equalsIgnoreCase("all");
		}

		else if (pName.equalsIgnoreCase("AltShieldBlocks")) ALT_GAME_SHIELD_BLOCKS = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("AltPerfectShieldBlockRate")) ALT_PERFECT_SHLD_BLOCK = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("Delevel")) ALT_GAME_DELEVEL = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("MagicFailures")) ALT_GAME_MAGICFAILURES = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("AltMobAgroInPeaceZone")) ALT_MOB_AGRO_IN_PEACEZONE = Boolean.parseBoolean(pValue);

		else if (pName.equalsIgnoreCase("AltGameExponentXp")) ALT_GAME_EXPONENT_XP = Float.parseFloat(pValue);
		else if (pName.equalsIgnoreCase("AltGameExponentSp")) ALT_GAME_EXPONENT_SP = Float.parseFloat(pValue);

		else if (pName.equalsIgnoreCase("AltGameFreights")) ALT_GAME_FREIGHTS = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("AltGameFreightPrice")) ALT_GAME_FREIGHT_PRICE = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("AltPartyRange")) ALT_PARTY_RANGE = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("AltPartyRange2")) ALT_PARTY_RANGE2 = Integer.parseInt(pValue);

		else if (pName.equalsIgnoreCase("CraftingEnabled")) IS_CRAFTING_ENABLED = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("LifeCrystalNeeded")) LIFE_CRYSTAL_NEEDED = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("SpBookNeeded")) SP_BOOK_NEEDED = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("AutoLoot")) AUTO_LOOT = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("AutoLootHerbs")) AUTO_LOOT_HERBS = Boolean.parseBoolean(pValue);

		else if (pName.equalsIgnoreCase("AltKarmaPlayerCanBeKilledInPeaceZone")) ALT_GAME_KARMA_PLAYER_CAN_BE_KILLED_IN_PEACEZONE = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("AltKarmaPlayerCanShop")) ALT_GAME_KARMA_PLAYER_CAN_SHOP = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("AltKarmaPlayerCanUseGK")) ALT_GAME_KARMA_PLAYER_CAN_USE_GK = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("AltKarmaPlayerCanTeleport")) ALT_GAME_KARMA_PLAYER_CAN_TELEPORT = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("AltKarmaPlayerCanTrade")) ALT_GAME_KARMA_PLAYER_CAN_TRADE = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("AltKarmaPlayerCanUseWareHouse")) ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("MaxPersonalFamePoints")) MAX_PERSONAL_FAME_POINTS = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("FortressZoneFameTaskFrequency")) FORTRESS_ZONE_FAME_TASK_FREQUENCY = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("FortressZoneFameAquirePoints")) FORTRESS_ZONE_FAME_AQUIRE_POINTS = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("CastleZoneFameTaskFrequency")) CASTLE_ZONE_FAME_TASK_FREQUENCY = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("CastleZoneFameAquirePoints")) CASTLE_ZONE_FAME_AQUIRE_POINTS = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("AltCastleForDawn")) ALT_GAME_CASTLE_DAWN = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("AltCastleForDusk")) ALT_GAME_CASTLE_DUSK = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("AltRequireClanCastle")) ALT_GAME_REQUIRE_CLAN_CASTLE = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("AltFreeTeleporting")) ALT_GAME_FREE_TELEPORT = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("AltSubClassWithoutQuests")) ALT_GAME_SUBCLASS_WITHOUT_QUESTS = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("AltMembersCanWithdrawFromClanWH")) ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("DwarfRecipeLimit")) DWARF_RECIPE_LIMIT = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("CommonRecipeLimit")) COMMON_RECIPE_LIMIT = Integer.parseInt(pValue);

		else if (pName.equalsIgnoreCase("ChampionEnable")) L2JMOD_CHAMPION_ENABLE =	Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("ChampionFrequency")) L2JMOD_CHAMPION_FREQUENCY = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("ChampionMinLevel")) L2JMOD_CHAMP_MIN_LVL = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("ChampionMaxLevel")) L2JMOD_CHAMP_MAX_LVL = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("ChampionHp")) L2JMOD_CHAMPION_HP = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("ChampionHpRegen")) L2JMOD_CHAMPION_HP_REGEN = Float.parseFloat(pValue);
		else if (pName.equalsIgnoreCase("ChampionRewards")) L2JMOD_CHAMPION_REWARDS = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("ChampionAdenasRewards")) L2JMOD_CHAMPION_ADENAS_REWARDS = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("ChampionAtk")) L2JMOD_CHAMPION_ATK = Float.parseFloat(pValue);
		else if (pName.equalsIgnoreCase("ChampionSpdAtk")) L2JMOD_CHAMPION_SPD_ATK = Float.parseFloat(pValue);
		else if (pName.equalsIgnoreCase("ChampionRewardLowerLvlItemChance")) L2JMOD_CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("ChampionRewardHigherLvlItemChance")) L2JMOD_CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("ChampionRewardItemID")) L2JMOD_CHAMPION_REWARD_ID = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("ChampionRewardItemQty")) L2JMOD_CHAMPION_REWARD_QTY = Integer.parseInt(pValue);

		else if (pName.equalsIgnoreCase("AllowWedding")) L2JMOD_ALLOW_WEDDING = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("WeddingPrice")) L2JMOD_WEDDING_PRICE = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("WeddingPunishInfidelity")) L2JMOD_WEDDING_PUNISH_INFIDELITY = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("WeddingTeleport")) L2JMOD_WEDDING_TELEPORT = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("WeddingTeleportPrice")) L2JMOD_WEDDING_TELEPORT_PRICE = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("WeddingTeleportDuration")) L2JMOD_WEDDING_TELEPORT_DURATION = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("WeddingAllowSameSex")) L2JMOD_WEDDING_SAMESEX = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("WeddingFormalWear")) L2JMOD_WEDDING_FORMALWEAR = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("WeddingDivorceCosts")) L2JMOD_WEDDING_DIVORCE_COSTS = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("EnableWarehouseSortingClan")) L2JMOD_ENABLE_WAREHOUSESORTING_CLAN = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("EnableWarehouseSortingPrivate")) L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("EnableWarehouseSortingFreight")) L2JMOD_ENABLE_WAREHOUSESORTING_FREIGHT = Boolean.parseBoolean(pValue);

		//CTF Mod
		else if (pName.equalsIgnoreCase("CTFAllowInterference"))CTF_ALLOW_INTERFERENCE = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("CTFAllowPotions"))CTF_ALLOW_POTIONS = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("CTFAllowSummon"))CTF_ALLOW_SUMMON = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("CTFOnStartRemoveAllEffects"))CTF_ON_START_REMOVE_ALL_EFFECTS = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("CTFOnStartUnsummonPet"))CTF_ON_START_UNSUMMON_PET = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("CTFEvenTeams"))CTF_EVEN_TEAMS = pValue;

		//TvT Mod
		else if (pName.equalsIgnoreCase("TvTAllowInterference"))TVT_ALLOW_INTERFERENCE = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("TvTAllowPotions"))TVT_ALLOW_POTIONS = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("TvTAllowSummon"))TVT_ALLOW_SUMMON = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("TvTOnStartRemoveAllEffects"))TVT_ON_START_REMOVE_ALL_EFFECTS = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("TvTOnStartUnsummonPet"))TVT_ON_START_UNSUMMON_PET = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("TvTEvenTeams"))TVT_EVEN_TEAMS = pValue;

		//DM Mod
		else if (pName.equalsIgnoreCase("DMAllowInterference"))DM_ALLOW_INTERFERENCE = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("DMAllowPotions"))DM_ALLOW_POTIONS = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("DMAllowSummon"))DM_ALLOW_SUMMON = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("DMOnStartRemoveAllEffects"))DM_ON_START_REMOVE_ALL_EFFECTS = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("DMOnStartUnsummonPet"))DM_ON_START_UNSUMMON_PET = Boolean.parseBoolean(pValue);

		//VIP Mod
		else if (pName.equalsIgnoreCase("VIPAllowInterference"))VIP_ALLOW_INTERFERENCE = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("VIPAllowPotions"))VIP_ALLOW_POTIONS = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("VIPOnStartRemoveAllEffects"))VIP_ON_START_REMOVE_ALL_EFFECTS = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("VIPMinLevel"))VIP_MIN_LEVEL = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("VIPMaxLevel"))VIP_MAX_LEVEL = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("VIPMinParticipants"))VIP_MIN_PARTICIPANTS = Integer.parseInt(pValue);

		//TownWar Mod
        else if (pName.equalsIgnoreCase("TownWarItemId")) TW_ITEM_ID = Integer.parseInt(pValue);
        else if (pName.equalsIgnoreCase("TownWarItemAmount")) TW_ITEM_AMOUNT = Integer.parseInt(pValue);
        else if (pName.equalsIgnoreCase("AllowKarma")) TW_ALLOW_KARMA = Boolean.parseBoolean(pValue);
        else if (pName.equalsIgnoreCase("DisableGK")) TW_DISABLE_GK = Boolean.parseBoolean(pValue);
        else if (pName.equalsIgnoreCase("TWTownId")) TW_TOWN_ID = Integer.parseInt(pValue);
        else if (pName.equalsIgnoreCase("TWAllTowns")) TW_ALL_TOWNS = Boolean.parseBoolean(pValue);
        else if (pName.equalsIgnoreCase("SendRessOnDeath")) TW_RESS_ON_DIE = Boolean.parseBoolean(pValue);

		else if (pName.equalsIgnoreCase("MinKarma")) KARMA_MIN_KARMA = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("MaxKarma")) KARMA_MAX_KARMA = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("XPDivider")) KARMA_XP_DIVIDER = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("BaseKarmaLost")) KARMA_LOST_BASE = Integer.parseInt(pValue);

		else if (pName.equalsIgnoreCase("CanGMDropEquipment")) KARMA_DROP_GM = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("AwardPKKillPVPPoint")) KARMA_AWARD_PK_KILL = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("MinimumPKRequiredToDrop")) KARMA_PK_LIMIT = Integer.parseInt(pValue);

		else if (pName.equalsIgnoreCase("PvPVsNormalTime")) PVP_NORMAL_TIME = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("PvPVsPvPTime")) PVP_PVP_TIME = Integer.parseInt(pValue);
		else if (pName.equalsIgnoreCase("GlobalChat")) DEFAULT_GLOBAL_CHAT = pValue;
		else if (pName.equalsIgnoreCase("TradeChat"))	DEFAULT_TRADE_CHAT = pValue;
		else if (pName.equalsIgnoreCase("GMAdminMenuStyle"))	GM_ADMIN_MENU_STYLE = pValue;
		else return false;
		return true;
	}

	private Config() { }

	/**
	 * Save hexadecimal ID of the server in the properties file.
	 * @param string (String) : hexadecimal ID of the server to store
	 * @see HEXID_FILE
	 * @see saveHexid(String string, String fileName)
	 * @link LoginServerThread
	 */
	public static void saveHexid(int serverId, String string)
	{
		Config.saveHexid(serverId, string, HEXID_FILE);
	}

	/**
	 * Save hexadecimal ID of the server in the properties file.
	 * @param hexId (String) : hexadecimal ID of the server to store
	 * @param fileName (String) : name of the properties file
	 */
	public static void saveHexid(int serverId, String hexId, String fileName)
	{
		try
		{
			Properties hexSetting = new Properties();
			File file = new File(fileName);
			//Create a new empty file only if it doesn't exist
			file.createNewFile();
			OutputStream out = new FileOutputStream(file);
			hexSetting.setProperty("ServerID",String.valueOf(serverId));
			hexSetting.setProperty("HexID",hexId);
			hexSetting.store(out,"the hexID to auth into login");
			out.close();
		}
		catch (Exception e)
		{
			_log.warning(StringUtil.concat("Failed to save hex id to ", fileName, " File."));
			e.printStackTrace();
		}
	}
	
	/**
	 * Loads flood protector configurations.
	 * 
	 * @param properties
	 *            properties file reader
	 */
	private static void loadFloodProtectorConfigs(final Properties properties)
	{
		loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_USE_ITEM, "UseItem", "4");
		loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_ROLL_DICE, "RollDice", "42");
		loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_FIREWORK, "Firework", "42");
		loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_ITEM_PET_SUMMON, "ItemPetSummon", "16");
		loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_HERO_VOICE, "HeroVoice", "100");
		loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SUBCLASS, "Subclass", "20");
		loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_DROP_ITEM, "DropItem", "10");
		loadFloodProtectorConfig(properties, FLOOD_PROTECTOR_SERVER_BYPASS, "ServerBypass", "5");
	}
	
	/**
	 * Loads single flood protector configuration.
	 * 
	 * @param properties
	 *            properties file reader
	 * @param config
	 *            flood protector configuration instance
	 * @param configString
	 *            flood protector configuration string that determines for which flood protector
	 *            configuration should be read
	 * @param defaultInterval
	 *            default flood protector interval
	 */
	private static void loadFloodProtectorConfig(final Properties properties,
	        final FloodProtectorConfig config, final String configString,
	        final String defaultInterval)
	{
		config.FLOOD_PROTECTION_INTERVAL = Integer.parseInt(properties.getProperty(StringUtil.concat("FloodProtector", configString, "Interval"), defaultInterval));
		config.LOG_FLOODING = Boolean.parseBoolean(properties.getProperty(StringUtil.concat("FloodProtector", configString, "LogFlooding"), "False"));
		config.PUNISHMENT_LIMIT = Integer.parseInt(properties.getProperty(StringUtil.concat("FloodProtector", configString, "PunishmentLimit"), "0"));
		config.PUNISHMENT_TYPE = properties.getProperty(StringUtil.concat("FloodProtector", configString, "PunishmentType"), "none");
		config.PUNISHMENT_TIME = Integer.parseInt(properties.getProperty(StringUtil.concat("FloodProtector", configString, "PunishmentTime"), "0"));
	}
}